template keyword with unqualified-ids
_N4567_.5.1.1 [expr.prim.general]
Mihai Rusu

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


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: 2008-02-27.00:00:00

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.

Date User Action Args
2009-08-03 00:00:00adminsetmessages: + msg2281
2009-08-03 00:00:00adminsetstatus: open -> extension
2008-02-27 00:00:00admincreate