Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ISO C++ 草案 n3290 中的一点:3.4.0 第二点
“在表达式的上下文中查找”的名称在找到表达式的范围内被查找为非限定名称。
有人可以用一个例子来解释这个陈述吗?
它表示将在包含表达式的范围内搜索名称。IE
namespace foo { struct bar { void foobar() { do_something(); } }; }
如果您有此代码,则将do_something在 、 和全局范围内搜索foobar名称(而不是在其他命名空间、结构或函数范围内)barfoo
do_something
foobar
bar
foo