3 Basic concepts [basic]3.3 Declarative regions and scopes [basic.scope]3.3.1 Point of declaration [basic.scope.pdecl]
| 3 基本概念 【基本】3.3 定义区域和作用域 【基本.作用域】3.3.1 声明点 【基本.作用域.声明点】
|
The point of declaration for a name is immediately after its complete declarator (clause 8) and before its initializer (if any), except as noted below. [Example:
Here the second
| 除了下面注解的情况外,某名字的声明点在其声明符(章节 8)完成后立即开始,并在其初始化符之前(如果有的话)。【例:
第二个
|
[Note: a nonlocal name remains visible up to the point of declaration of the local name that hides it. [Example:
declares a local array of two integers. ]]
| 【注:非局部名字保持其可见性直到隐藏它的局部名字的声明点。【例:
声明了一个两个整数的局部数组。】】
|
The point of declaration for an enumerator is immediately after its enumerator-definition. [Example:
Here, the enumerator
| 枚举符的声明点在枚举符定义后立即开始。【例:
此处,枚举符
|
After the point of declaration of a class member, the member name can be looked up in the scope of its class. [Note: this is true even if the class is an incomplete class. For example,
--end note]
| 在类成员的声明点之后,该成员名可以在其类作用域中被查找到。【注:即使该类不完整也是如此。例如,
--注完】
|
The point of declaration of a class first declared in an elaborated-type-specifier is as follows:
| 如下情况,类的声明点由一个详细类型限定词首先声明:
|
[Note: friend declarations refer to functions or classes that are members of the nearest enclosing namespace, but they do not introduce new names into that namespace (7.3.1.2). Function declarations at block scope and object declarations with the extern specifier at block scope refer to declarations that are members of an enclosing namespace, but they do not introduce new names into that scope. ]
| 【注:对函数或类的友元声明指代其最近的包含其的名字空间中的成员,但它们不向名字空间中引入新的名字(7.3.1.2)。在块作用域中的函数声明和在块作用域中带有 extern 限定词的对象声明指代包含其的名字空间成员,但它们不向该作用域中引入新名字。】
|
[Note: For point of instantiation of a template, see 14.7.1. ]
| 【注:模板实例化点,参见 14.7.1。】
|
PREV [basic.scope] | NEXT [basic.scope.local] | 上一页 【基本.作用域】 | 下一页 【基本.作用域.局部】 |
3.3.1 - [basic.scope.pdecl] - 【基本.作用域.声明点】
最新推荐文章于 2004-11-07 15:31:00 发布
请不要转载本文;请不要以任何形式重新出版,发布本文;请在下载本文 24 小时内将其删除;禁止将本文用于商业目的。