Movatterモバイル変換


[0]ホーム

URL:


This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 118e. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2025-11-05


1161. Dependentnested-name-specifier in a pointer-to-member declarator

Section:13.8  [temp.res]    Status:C++11    Submitter:GB    Date:2010-08-03

[Voted into the WP at the November, 2010 meeting.]

N3092 comment GB 44

It is not clear from the current wording of 13.8 [temp.res]whether the following is well-formed or not:

    template<typename T> struct id { typedef T type; };    template<typename T> void f() { int id<T>::type::*p = 0; }    struct A { };    int main() { f<A>(); }

Iftypename is required before the use ofid<T>::type, it is not permitted by the currentsyntax.

Proposed resolution (August, 2010):

Change 13.8 [temp.res] paragraph 5 as follows:

A qualified name used as the name in amem-initializer-id, abase-specifier, or anelaborated-type-specifier is implicitly assumed toname a type, without the use of thetypenamekeyword.In anested-name-specifier thatimmediately contains anested-name-specifier thatdepends on a template parameter, theidentifier orsimple-template-id is implicitly assumed to name atype, without the use of thetypenamekeyword. [Note: thetypename keywordis not permitted by the syntax of theseconstructs. —end note]



[8]ページ先頭

©2009-2025 Movatter.jp