This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Namespace Lookup
- To: Martin von Loewis <martin at mira dot isdn dot cs dot tu-berlin dot de>
- Subject: Re: Namespace Lookup
- From: Alexandre Oliva <oliva at dcc dot unicamp dot br>
- Date: 10 Mar 1998 05:10:15 -0300
- Cc: egcs at cygnus dot com
- References: <199803100716.IAA00376@mira.isdn.cs.tu-berlin.de>
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