Title
template keyword with unqualified-ids
Status
nad
Section
_N4567_.5.1.1 [expr.prim.general]
Submitter
Mihai Rusu

Created on 2008-02-27.00:00:00 last changed 24 months ago

Messages

Date: 2009-07-15.00:00:00

Rationale (July, 2009):

This suggestion would need a full proposal and discussion by the EWG before the CWG could consider it.

Date: 2017-11-15.00:00:00

[Addressed with a different approach by paper P0846R0, adopted at the November, 2017 meeting.]

Consider the following:

    namespace N {
        struct A { };
        template<typename T>
        T func(const A&) { return T(); }
    }

    void f() {
        N::A a;
        func<int>(a);    // error
    }

Although argument-dependent lookup would allow N::func to be found in this call, the < is taken as a less-than operator rather than as the beginning of a template argument list. If the use of the template keyword for syntactic disambiguation were permitted for unqualified-ids, this problem could be solved by prefixing the function name with template, allowing the template-id to be parsed and argument-dependent lookup to be performed.

History
Date User Action Args
2022-04-28 06:18:22adminsetstatus: extension -> nad
2009-08-03 00:00:00adminsetmessages: + msg2281
2009-08-03 00:00:00adminsetstatus: open -> extension
2008-02-27 00:00:00admincreate