Christof Petig <[EMAIL PROTECTED]> writes:

> Perhaps the namepace of the first argument determines the namespace
> searched for the operator ?

All arguments determine the namespaces search for functions. This is
called Koenig lookup (after Andrew Koenig, inventor of this
mechanism), or argument-dependent lookup. It applies uniformly to all
unqualified function calls, whether operator or not.

As a result, you should not overload operators based only on types
from std. Instead, any operator you overload should involve one of
your own types as well. It is an error to extend namespace std in an
application.

Regards,
Martin


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]


Reply via email to