On Nov 16, 2:15 pm, Daniel Krügler
wrote:
> > > class B : public A
> > > {
> > > public:
> > > B(sometype* param) : A(param) {}; // <== Compiler Error
>
> > > /* further member functions */
> > > }
>
> My explanation is a bit incomplete, because it did not
> explicitly show why usage of A versus A
> valid in this context:
>
> 1) [temp.local]/2 says:
>
> "Within the scope of a class template specialization or
> partial specialization, when the injected-class-name is
> not followed by a <, it is equivalent to the injected-
> class-name followed by the template-arguments of the
> class template specialization or partial specialization
> enclosed in <>.[..]"
The declaration in question is not a class template specialization of
any sort - because "B" is not a class template at all. Instead, B is a
class, and §14.6 applies only to class template declarations - not
class declarations -, so there is no reason why the C++ compiler
should recognize "A" as "A
Greg
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
template class constructor shall be called from the initializer list of the inheriting, non-template class constructor