Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

How are namespaces specialized in cppreference.com?


Asked by Selene Richardson on Dec 08, 2021 FAQ



Each member of an inline namespace can be partially specialized , explicitly instantiated or explicitly specialized as if it were a member of the enclosing namespace. Qualified name lookup that examines the enclosing namespace will include the names from the inline namespaces even if the same name is present in the enclosing namespace.
Just so,
It is allowed to add template specializations for any standard library function template to the namespace std only if the declaration depends on at least one program-defined type and the specialization satisfies all requirements for the original template, except where such specializations are prohibited.
Next, Names introduced by friend declarations within a non-local class X become members of the innermost enclosing namespace of X, but they do not become visible to ordinary name lookup (neither unqualified nor qualified) unless a matching declaration is provided at namespace scope, either before or after the class definition.
Thereof,
If the primary member template is explicitly (fully) specialized for a given (implicit) specialization of the enclosing class template, the partial specializations of the member template are ignored for this specialization of the enclosing class template.
Subsequently,
Program-defined specializations are explicit template specializations or partial specializations that are not part of the C++ standard library and not defined by the implementation.