c++ - 引用的上下文是什么意思?

标签 c++ reference language-lawyer

N3797 工作草案 3.4.3.2/3 节开头有一段引述:

Given X::m (where X is a user-declared namespace), or given ::m (where X is the global namespace), if S(X, m) is the empty set, the program is ill-formed. Otherwise, if S(X, m) has exactly one member, or if the context of the reference is a using-declaration (7.3.3), S(X, m) is the required set of declarations of m.

在那种情况下,引用的上下文是什么意思?

最佳答案

“::m”或“X::m”用于指代某物的上下文。

在这种特殊情况下,如果代码具有 using::musing X::m; 的形式,它们是 using-declarations.

关于c++ - 引用的上下文是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24261826/

相关文章:

c - 从单链表中删除节点

c++ - 通过引用另一个类方法传递 vector 成员变量

c++ - 返回对模板 vector 的引用

c++ - 数组新表达式中的直接初始化与列表初始化

c++ - 对于类模板定义中由 this-> 限定的类/命名空间名称,是否应该延迟名称查找?

c++ - 初始化中模板转换运算符类型推导的规则是什么?

c++ - 浮点运算,C 输出

c++ - 多种窗口样式

c++ - 为什么这个结合赋值和相等检查的 if 语句返回 true?

c++ - 何时对使用 'delete' 创建的临时对象调用 `new` ?