为什么名称查找在找到 using 指令隐式声明的实体时不会停止?

Why does the name lookup does not stop when it finds the entity implicitly declared by using directive?

这是代码示例:

#include<iostream>
using namespace std;
namespace B
{
  int ohoh=2;
}

namespace A
{
  int ohoh=666;
  namespace C 
  {
      //using B::ohoh;(as if declared by using directive) //why does the lookup not stops here?
      int foo()
      {
        using namespace B;
        cout<<ohoh<<endl;
      }
  }
}

int main()
{
    A::C::foo();
}  

输出是 666 而不是 2。为什么?

引自cppref

For an unqualified name, that is a name that does not appear to the right of a scope resolution operator ::, name lookup examines the scopes as described below, until it finds at least one declaration of any kind, at which time the lookup stops and no further scopes are examined. (Note: lookup from some contexts skips some declarations, for example, lookup of the name used to the left of :: ignores function, variable, and enumerator declarations, lookup of a name used as a base class specifier ignores all non-type declarations)

For the purpose of unqualified name lookup, all declarations from a namespace nominated by a using directive appear as if declared in the nearest enclosing namespace which contains, directly or indirectly, both the using-directive and the nominated namespace.

从上面引用的段落来看,名称查找应该在最近的 namespace C 停止,我在 code.Why 中评论的地方它不会停止并找到 A::ohoh 吗?

顺便说一下,我想我应该尽可能少地使用 using 指令。

For the purpose of unqualified name lookup, all declarations from a namespace nominated by a using directive as if declared in the nearest enclosing namespace which contains [...] both the using-directive and the nominated namespace.

在这种情况下,包含 B 和 using-directive 的最近命名空间是全局命名空间。因此,B 中的所有名称都出现在 A::C::foo 中,就好像它们是在全局命名空间中声明的一样。当搜索名称 ohoh 时,A 在全局命名空间之前被搜索,因此 A::ohoh 是找到的第一个声明并且名称查找在那里停止。