Title
Explicit specialization examples are still incorrect
Status
cd1
Section
13.9.4 [temp.expl.spec]
Submitter
Jason Shirk

Created on 2002-01-29.00:00:00 last changed 196 months ago

Messages

Date: 2003-04-15.00:00:00

[Voted into WP at April 2003 meeting.]

Date: 2002-04-15.00:00:00

Proposed Resolution (4/02):

Fix the example in 13.9.4 [temp.expl.spec] paragraph 18 to read:

  template<class T1> class A {
    template<class T2> class B {
      template<class T3> void mf1(T3);
      void mf2();
    };
  };
  template<> template<class X>
    class A<int>::B {
      template<class T> void mf1(T);
    };
  template<> template<> template<class T>
    void A<int>::B<double>::mf1(T t) { }
  template<class Y> template<>
    void A<Y>::B<double>::mf2() { } // ill-formed; B<double> is specialized but
                                    // its enclosing class template A is not
Date: 2004-09-10.00:00:00

The examples corrected by issue 24 are still wrong in one case.

In item #4 (a correction to the example in paragraph 18), the proposed resolution is:

  template<class T1> class A {
    template<class T2> class B {
      template<class T3> void mf1(T3);
        void mf2();
      };
  };
  template<> template<class X>
    class A<int>::B { };
  template<> template<> template<class T>
    void A<int>::B<double>::mf1(T t) { }
  template<class Y> template<>
    void A<Y>::B<double>::mf2() { } // ill-formed; B<double> is specialized but
                                    // its enclosing class template A is not

The explicit specialization of member A<int>::B<double>::mf1 is ill-formed. The class template A<int>::B is explicitly specialized and contains no members, so any implicit specialization (such as A<int>::B<double>) would also contain no members.

History
Date User Action Args
2008-10-05 00:00:00adminsetstatus: wp -> cd1
2003-04-25 00:00:00adminsetmessages: + msg875
2003-04-25 00:00:00adminsetstatus: ready -> wp
2002-11-08 00:00:00adminsetstatus: drafting -> ready
2002-05-10 00:00:00adminsetmessages: + msg645
2002-05-10 00:00:00adminsetstatus: open -> drafting
2002-01-29 00:00:00admincreate