This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 115a. See for the official list.


1057. decltype and the current instantiation

Section:  [temp.dep.type]     Status: C++11     Submitter: Mike Miller     Date: 2010-03-18

[Voted into the WP at the March, 2011 meeting as part of paper N3262.]

According to [temp.dep.type] paragraph 3,

A template argument that is equivalent to a template parameter (i.e., has the same constant value or the same type as the template parameter) can be used in place of that template parameter in a reference to the current instantiation.

This would presumably include something like

    template<typename T> struct A {
        struct B { };
        A<decltype(T())>::B b;    // no typename

However, this example is rejected by current implementations. Does this need to be clarified in the existing wording?

Notes from the November, 2010 meeting:

The example is not well-formed; if T is an rvalue reference type, for example, decltype(T()) is not equivalent to T.

Proposed resolution (November, 2010) [SUPERSEDED]:

This issue is resolved by the resolution of issue 1056.