
Jim Hyslop <jhyslop@dreampossible.ca> writes:
Robert Ramey <ramey <at> rrsd.com> writes:
Here is the background/history.
[...]
Jen's library had the & operator - which at first surprised and confused me.
My point exactly - has this group forgotten the Principle of Least Astonishment?
There's always a tension between innovation and familiarity.
[...]
I suspected that the & operator was chosen due to its operator precedence being at a particular spot in the operator precedence hierarchy[...] Except that operator precedence only applies to "built-in" operators - user defined operators are function calls, and have that level of precedence.
No, that's wrong. In fact, IIRC, the C++ built-in operator bindings can't be described correctly in terms of operator precedence, but you can get pretty close. And to the extent you can get close, user-defined operators bind exactly as the builtin operators of the same names would. -- Dave Abrahams Boost Consulting www.boost-consulting.com