Title
Confusing wording regarding multiple template<> prefixes
Status
dup
Section
13.9.4 [temp.expl.spec]
Submitter
Richard Smith

Created on 2014-09-03.00:00:00 last changed 122 months ago

Messages

Date: 2014-11-15.00:00:00

Rationale (November, 2014):

This issue is a duplicate of issue 529.

Date: 2022-11-20.07:54:16

According to 13.9.4 [temp.expl.spec] paragraph 15,

A member or a member template may be nested within many enclosing class templates. In an explicit specialization for such a member, the member declaration shall be preceded by a template<> for each enclosing class template that is explicitly specialized. [Example:

  template<class T1> class A {
    template<class T2> class B {
      void mf();
    };
  };
  template<> template<> class A<int>::B<double>;
  template<> template<> void A<char>::B<char>::mf();

end example]

However, in the declaration of A<int>::B<double>, A<int> is not explicitly instantiated, it is implicitly instantiated.

History
Date User Action Args
2014-11-24 00:00:00adminsetmessages: + msg5305
2014-09-03 00:00:00admincreate