B
Brad Eck
"The only operators that cannot be overloaded
are :: (scope resolution), . (member selection), and .* (member
selection through pointer to function). Quoting from Stroustrup's 3rd
edition of _The C++ Programming Language_, section 11.2 (page 263),
these three operators 'take a name, rather than a value, as their
second operand and provide the primary means of referring to members.
Allowing them to be overloaded would lead to subtleties.'"
First, I've seen ?: and sizeof added to this list. Someone also
mentioned 'delete' but Stroustrup doesn't refer to it as one. In fact,
it's in the list of overloadable operators.
Second, what is meant by 'take a name'? What is meant by 'subtleties'?
Any thoughts as to the detailed reasoning behind these?
are :: (scope resolution), . (member selection), and .* (member
selection through pointer to function). Quoting from Stroustrup's 3rd
edition of _The C++ Programming Language_, section 11.2 (page 263),
these three operators 'take a name, rather than a value, as their
second operand and provide the primary means of referring to members.
Allowing them to be overloaded would lead to subtleties.'"
First, I've seen ?: and sizeof added to this list. Someone also
mentioned 'delete' but Stroustrup doesn't refer to it as one. In fact,
it's in the list of overloadable operators.
Second, what is meant by 'take a name'? What is meant by 'subtleties'?
Any thoughts as to the detailed reasoning behind these?