M
mrstephengross
Ok, I've got code that looks something like this:
==================================================
template<typename T1, typename T2>
class Base
{
public:
explicit Base(const T1 & t1) { /* ... */ }
};
template<typename T1, typename T2, typename T3>
class Derived : public Base<T1, T2>
{
public:
Derived() : Base(my_t3) { /* ... */ }
private:
T3 my_t3;
};
====================================================
GCC 3.3.1 reports the following error:
In constructor `Derived<T1, T2, T3>:erived()':
error: class `Derived<T1, T2, T3>' does not have any field named
`template<class T1, T2> class Base'
It would seem that GCC interprets my initialization of Base in
Derived's constructor as a field assignment. Is my syntax wrong? Is
there some way to more directly indicate that I'm invoking Base's
constructor?
Thanks,
--Steve ([email protected])
==================================================
template<typename T1, typename T2>
class Base
{
public:
explicit Base(const T1 & t1) { /* ... */ }
};
template<typename T1, typename T2, typename T3>
class Derived : public Base<T1, T2>
{
public:
Derived() : Base(my_t3) { /* ... */ }
private:
T3 my_t3;
};
====================================================
GCC 3.3.1 reports the following error:
In constructor `Derived<T1, T2, T3>:erived()':
error: class `Derived<T1, T2, T3>' does not have any field named
`template<class T1, T2> class Base'
It would seem that GCC interprets my initialization of Base in
Derived's constructor as a field assignment. Is my syntax wrong? Is
there some way to more directly indicate that I'm invoking Base's
constructor?
Thanks,
--Steve ([email protected])