2011-08-22 16 views
0

点从2003年C++ 03文件:n3290:Elaborated类型说明符语法已更改?

阐述类型指示符:3.4.4节,第1段:

 "An elaborated-type-specifier may be used to refer to a 
     previously declared class-name or enum-name even though 
     the name has been hidden by a non-type declaration. **The 
     class-name or enum-name in the elaborated-type-specifier 
     may either be a simple identifier or be a qualified-id.**" 

但在n3290草案他们改变了阐述类型说明符(7.1 .6.3)

7.1.6.3:阐述类型说明符

elaborated-type-specifier: 
    class-key attribute-specifier-seqopt nested-name-specifieropt identifier 
    class-key nested-name-specifieropt templateopt simple-template-id 
    enum nested-name-specifieropt identifier 

可我知道

1)什么是早期的语法支持的问题类型名C++ 03

 7.1.5.3 Elaborated type specifiers 

elaborated-type-specifier: 
     class-key ::opt nested-name-specifieropt identifier 
     class-key ::opt nested-name-specifieropt templateopt template-id 
     enum ::opt nested-name-specifieropt identifier 
     typename ::opt nested-name-specifier identifier 
     typename ::opt nested-name-specifier templateopt template-id 

2)是真正的编译器是以下/不folling这一规则...(这编译器支持这种变化)

3)当即将上述点3.4.4 /第一

 The class-name or enum-name in the elaborated-type-specifier 
     may either be a simple identifier or be a qualified-id 

为什么它不是在C++允许0X。

请有人解释一下吗? 请有人解释一下吗?

(IAM时试图添加的C++ 0x TAG它不..tagging ..please任何一个..Add的C++ 0x的标签?)

回答

1
  1. 这是一个简单的重组。 typename-specifier现在不是一种elaborated-type-specifier,但它们都是trailing-type-specifier
  2. 目前尚不清楚编译器应该做什么。你能想到有效的C++ 03代码不是有效的C++ 0x吗?
  3. 究竟是不是在C++ 0x允许的?语法表示允许有合格的ID,如nested-name-specifier_opt identifier