What does a leading :: mean in “using namespace ::X” in C++

前端 未结 4 1444
南旧
南旧 2020-12-31 03:51

can somebody explain me the difference between the following namespace usages:

using namespace ::layer::module;

and

using namespa

4条回答
  •  春和景丽
    2020-12-31 04:35

    The second case might be X::layer::module where using namespace X has already happened.

    In the first case the prefix :: means "compiler, don't be clever, start at the global namespace".

提交回复
热议问题