[comp.object] operator::

bobatk@microsoft.UUCP (Bob ATKINSON) (07/28/90)

I am trying to understand why :: is not overloadable.  E&S says in 13.4
"The reason for disallowing the overloading  of ., .*, and :: is that
they already have a predefined meaning for objects of any class as their
first operand."  Though this is true of . and .*, the first operand of
:: is a class name, not an class instance.  There therefore seems to me
to be no confusion possible.  Is there another reason that was not
documented in E&S?

I also do not fully understand the reasoning behind the prohibition of 
overloading . and .*.  Yes, they have a predefined meaning for objects
of any class as their first operand, but _only_ if their second operand
is of type "pointer to member of <the appropriate class>".  Why not permit
overloadings which specify second arguments of other types?

My motivation for asking these questions comes from experiences in trying
to choose appropriate operators in C++ to express operations that exist today
as operators in some other widely used notations.  Given the fixed set of
operators, their fixed arities, precedences and associativities, choosing
these operators is a very tedious exercise in design tradeoffs.  _Any_ 
increase set of available operators would be greatly appreciated.


	Bob Atkinson
	Microsoft Applications Architecture Group