A point from the ISO C++ draft (n3290): 3.4.3.2/1 Namespace members
If the nested-name-specifier of a qualified-id nominates a namespace,
the name specified after the nested-name-specifier is looked up in
the scope of the namespace. If a qualified-id starts with ::, the
name after the :: is looked up in the global namespace. In either
case, the names in a template-argument of a template-id are looked up
in the context in which the entire postfix-expression occurs.
Here can any one explain about the BOLD part …. and from earlier c++03 draft to c++0x draft he added
If a qualified-id starts with ::, the name after the :: is looked up
in the global namespace.
can any one explain with an example program please
::Sis a qualified-id.In the qualified-id
::S::f,S::is a nested-name-specifier.In informal terms, a nested-name-specifier is the part of the id that
Very informally, an id is either a qualified-id or an unqualified-id. If the id is a qualified-id, it is actually composed of two parts: a nested-name specifier followed by an unqualified-id.
Given:
Ais an unqualified-id.::Ais a qualified-id but has no nested-name-specifier.A::Bis a qualified-id andA::is a nested-name-specifier.::A::Bis a qualified-id andA::is a nested-name-specifier.A::B::Fis a qualified-id and bothB::andA::B::are nested-name-specifiers.::A::B::Fis a qualified-id and bothB::andA::B::are nested-name-specifiers.Another example:
EDIT:
In response to your comment, I believe that statement simply means that the arguments of a template are handled w.r.t the context and line by which they are declared. For example,
in
f.~foo();, foo is looked up withinf., and within the scope offoo<int>, it is valid to refer to it just with withfoo.