This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 116a. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2024-12-19


1994. Confusing wording regarding multiple template<> prefixes

Section: 13.9.4  [temp.expl.spec]     Status: dup     Submitter: Richard Smith     Date: 2014-09-03

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.

Rationale (November, 2014):

This issue is a duplicate of issue 529.