unnamed namespaces and specializations

Gabriel Dos Reis gdr@integrable-solutions.net
Fri Aug 1 16:17:00 GMT 2003


Benjamin Kosnik <bkoz@redhat.com> writes:

| I would dearly love it if this code below is valid. 
| 
| I'm getting conflicting reports: g++ says no, icc says yes. I'm not
| quite certain myself, after reading 7.3.1.1 - Unnamed namespaces  and
| the other bits.
| 
| Thoughts?

g++ is right :-)

14.7.3/2

  An explicit specialization shall be declared in the namespace of
  which the template is a member, or, for member templates, in the
  namespace of which the enclosing class or enclosing class template
  is a member. An explicit specialization of a member function, member
  class or static data member of a class template shall be declared in
  the namespace of which the class template is a member. Such a
  declaration may also be a definition. If the declaration is not a
  definition, the specialization may be defined later in the
  name-space in which the explicit specialization was declared, or in
  a namespace that encloses the one in which the explicit
  specialization was declared. 


The first sentence is the most relevant here.

-- Gaby



More information about the Libstdc++ mailing list