Title
Overlap between Koenig and normal lookup
Status
tc1
Section
6.4.2 [basic.lookup.argdep]
Submitter
Derek Inglis

Created on 1999-09-03.00:00:00 last changed 208 months ago

Messages

Date: 2000-10-15.00:00:00

Proposed Resolution (10/00):

Immediately preceding the example at the end of 6.4.2 [basic.lookup.argdep] paragraph 2, add the following:

[Note: the namespaces and classes associated with the argument types can include namespaces and classes already considered by the ordinary unqualified lookup.]
Date: 2004-09-10.00:00:00

The description of Koenig lookup in 6.4.2 [basic.lookup.argdep] paragraph 1 says,

...other namespaces not considered during the usual unqualified lookup (6.4.1 [basic.lookup.unqual] ) may be searched.
Does this mean that Koenig lookup does not search namespaces that were already searched during the usual unqualified lookup? The answer is academic except for the two-stage lookup during template instantiation. If a given namespace is searched in the context of the template definition, are declarations in that namespace in the instantiation context ignored during the Koenig lookup? For instance,
    void f(int);

    template <class T> void g(T t) {
        f(t);
    }

    enum E { e };

    void f(E);

    void h() {
        g(e);
    }
In this example, the call f(t) in the template function will resolve to f(E) if Koenig lookup reexamines already-searched namespaces and to f(int) if not.
History
Date User Action Args
2003-04-25 00:00:00adminsetstatus: dr -> tc1
2000-11-18 00:00:00adminsetstatus: ready -> dr
2000-05-21 00:00:00adminsetstatus: review -> ready
2000-02-23 00:00:00adminsetmessages: + msg215
2000-02-23 00:00:00adminsetstatus: open -> review
1999-09-03 00:00:00admincreate