This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: ADL Help
- From: Ian Lance Taylor <iant at google dot com>
- To: Perry Smith <pedz at easesoftware dot com>
- Cc: gcc-help GCC <gcc-help at gcc dot gnu dot org>
- Date: 06 Nov 2006 14:20:22 -0800
- Subject: Re: ADL Help
- References: <8A51BBAF-517D-453A-8AB1-EA9C289C6DDF@easesoftware.com>
Perry Smith <pedz@easesoftware.com> writes:
> There are several pages just like it. In particular this bullet would
> seem to apply but it must not for some reason:
>
> | If T is a class type, its associated classes are the class itself and
> | its direct and indirect base classes. Its associated namespaces are
> | the namespaces in which its associated classes are defined.
>
> It seems like the "here 1" version would be found but it is not. Can
> you help me to understand what I'm missing?
Argument dependent lookup never finds a member function of a class.
It only finds functions declared in namespaces.
Don't get confused by the stuff about "associated classes." Argument
dependent lookup doesn't look at the member functions of an associated
class. ADL does look at the friend functions of associated classes--
that's why the concept of associated classes exists.
Ian