Sujet : Re: We have a new standard!
De : Keith.S.Thompson+u (at) *nospam* gmail.com (Keith Thompson)
Groupes : comp.lang.c++Date : 02. Jan 2025, 22:38:17
Autres entêtes
Organisation : None to speak of
Message-ID : <87y0zssxpy.fsf@nosuchdomain.example.com>
References : 1 2 3
User-Agent : Gnus/5.13 (Gnus v5.13)
Muttley@dastardlyhq.com writes:
[...]
Plus overloading << and >> was a cretinous decision. There was zero reason
he couldn't have created some new operators to avoid confusion, <<< and >>>
or <= , => for example where such combinations in C would never be legal
syntax anyway.
<= is already an operator. <<< and >>> are not, but at least >>>
exists in some other languages, which could lead to confusion
(admittedly that's not a very strong argument).
I wouldn't have minded having new operators for I/O, but I'm not sure
what characters would have been used. Perhaps something involving
"@"?
In any case, I don't see the overloading of << and >> for I/O as
a big problem. The predecence is a bit funny, but that can be
addressed with parentheses. Visually, << and >> show the direction
in which the data is flowing. (The statefulness of C++ streams is
deeply annoying, though.)
-- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.comvoid Void(void) { Void(); } /* The recursive call of the void */