lundi 26 octobre 2015

derived class with templated parent class

I have parent class

template <class T_ENUM>
class A
{
public:
  A(int*);
  ~A();
}

now when i create a derived class, is it allowed to initialize the template on parent class ?

enum Benum {e1, e2, e3};

class B : public A<Benum >
{
public:
  B(int* a):A(a);
  ~B();
}

I get following compile error as

undefined reference to `B::B(int*)'

in another file where i include the class defenition header file.

Aucun commentaire:

Enregistrer un commentaire