Search code examples
c++namespacessys

what's the meaning of putting :: before a namespace name?


Here sys is a namespace.
If we use sys::xx, I know exactly the meaning of ::, but I saw a code, it's using

::sys::xx;

what's the meaning by putting :: before a namespace?


Solution

  • It means: look in the global namespace (::) for something named sys. Then look in that scope (class/struct/namespace) for something called xx.