A nested namespace specifier is:
nested-name-specifier :
class-or-namespace-name::nested-name-specifier(optional)
That is, a non-empty list of namespaces and classnames, each followed by ::, representing a relative branching in the overall "namespace tree" of the program. For example, my_namespace::
, my_namespace::inner_namespace::
, my_namespace::my_class::
, and my_class::
.
Note specifically the difference from:
qualified-namespace-specifier :
::(optional) nested-name-specifier(optional) class-or-namespace-name
In that a nested-name-specifier may not be absolute (prefixed with ::
to refer to the global scope), while a qualified-namespace-specifier can be, but doesn't end with ::
.
In your example, ::S
resolves to the function ::S()
, and not the struct (precendence rules for that were discussed here on Stackoverflow in the question you linked to at the start of your question), so it is not a nested name specifier.