This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Namespace Lookup


Martin von Loewis writes:

> Is the following correct C++? If so, why? I.e. why is the operator<<
> visible?

Because of a rule called Koenig lookup [basic.lookup.koenig].  For
short, it states that a function argument of a particular class type
causes functions in the scope of that class to be considered for
overload resolution.

-- 
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]