Liste des Groupes | Revenir à cl c++ |
On Thu, 2 Jan 2025 17:54:18 +0100
David Brown <david.brown@hesbynett.no> wibbled:On 02/01/2025 15:07, Muttley@DastardlyHQ.org wrote:>Overloading << and >> was unnecessary and confusing.>
Disagreed. I really don't think it was problematic. Nor did any of the
/many/ people who were involved in the design of C++. Remember, the
language and library has always been discussed, prototyped, and tested
by lots of people before being released. Stroustrup was the main
language designer, but he was far from alone.
Committees often don't come up with optimal solutions. Using the same operator
for 2 entirely different operations unrelated in either concept or function
when there was no need to was illogical and perverse.
The meaning of "cout << 0xFF << 2 << 1234;" is obviously a chain of>
outputs - output 0xff, output 2, output 1234. Regardless of the
I would expect all mathematical operations to work in EXACTLY the same way
in an output stream.
Eg I expect the output to be 256 here:
>
std::cout << 255 + 1 << std::endl;
Yet here there is no maths involved:
>
std::cout << 255 << 1 << std::endl;
>
Thats perverse.
Les messages affichés proviennent d'usenet.