[Pythonmac-SIG] CXX and SCXX

Mark Mitchell mark@codesourcery.com
Fri, 03 Sep 1999 16:40:36 -0700


>>>>> "James" == James A Crotinger <jac@lanl.gov> writes:

    James> Hmmm. I never put template parameters after a constructor
    James> name. I don't even know if it is legal. But certainly CW
    James> accepts it without the explicit keyword. At any rate, it is
    James> not needed and removing the template parameters does indeed
    James> fix it:

Easy one:

   14.6.1  Locally declared names                            [temp.local]

    1 Within the scope of a class template, when the name of the template is
    neither  qualified  nor followed by <, it is equivalent to the name of
    the template followed  by  the  template-parameters  enclosed  in  <>.
    [Example:  the  constructor  for  Set  can  be referred to as Set() or
    Set<T>().  ] Other specializations (_temp.expl.spec_) of the class can
    be  referred  to  by  explicitly qualifying the template name with the
    appropriate template-arguments.  [Example:
    template<class T> class X {
	    X* p;                   // meaning X<T>
	    X<T>* p2;
	    X<int>* p3;
    };
    --end example]

So, your compiler is buggy.

    James> (BTW, what does explicit buy you on default constructors? I
    James> had not seen this construct before, and have only used it
    James> on single-argument constructors.)

It doesn't buy you anything, so far as I know, or can see from a quick
peek at [class.conv.ctor].

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com