Re:Many programming languages have infix expressions, but ge...
by miloshh on Monday February 01, 2010 @08:54AM
(#1092322)
It seems like, to have associativity in the sense of
"(a+b)+c = a+(b+c)", you'd have to extend << to also become the string concatenation operator in C++. There are quite a few rules that need to hold to make it work...
An example would be C++ stream << operator which takes a stream on the left, a string on the right, and returns a stream (after writing the string into the stream). This is so that you can do chaining:
I don't think that there are any mathematical operators that work this way though.