
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?
I was just starting to understand the usage of templates beyond simple parameterized class declarations/definitions at it took me a little while to actually see what the & operator was doing in this case.
Templates are a red herring here - the use of operator & in this case is independent of templates. [...]
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.
The usage of << and >> are my own and are obviously analog to the concept of using << and >> for stream input / output respectively. These I understand and agree with, because the analogy is well-known and understood.
So, for better or worse, that's how we arrived here. Thanks for the explanation. Now that the library has been accepted, I'm not expecting this will change (at least not in the near future), I just wanted to know the rationale behind it. I'll have to pay more attention in the future ;=)
-- Jim