Liste des Groupes | Revenir à cl c++ |
On Sat, 4 Jan 2025 12:31:33 +0100Did you actually have any points other than "I want the code I write to work the way I want it to work, and sod the rest of the programming world" ? If that's not it, then what did you mean when you incorrectly claimed that the precedence of << and >> in C++ is inconsistent?
David Brown <david.brown@hesbynett.no> gabbled:On 04/01/2025 11:17, Muttley@dastardlyhq.com wrote:I'm tired of your straw men. If you can't discuss what I'm talking about then maybe stay silent.On Fri, 03 Jan 2025 11:22:09 -0800>
Keith Thompson <Keith.S.Thompson+u@gmail.com> gabbled:Muttley@DastardlyHQ.org writes:>Don't be obtuse for the sake of arguing.>
You used the word "expect". I think you meant that you *want* it to
behave in certain ways. You know the existing rules, and you strongly
dislike them.
What I would expect in a language is for mathematical operators to have the
same precendence with numeric types whether overloaded or not. This isn't thecase with << and >>.>
>
In C++, << and >> have the same precedence with all types - just like all the other operators. The precedences are built into the grammar of the language.
>
Are you suggesting that C++ compilers should somehow have omniscient knowledge of user-defined types to know whether some class is a "numeric" type or some other kind of type which should have different precedences for different operators? Do you think that would lead to a language that is clearer and easier to learn?
Les messages affichés proviennent d'usenet.