V
Vikas
I have a template class called Base with child classes called Child1
and Child2 as follows:
template <typename T>
class Base
{
…
};
class Child1 : Base<Concrete1>
{
…
};
class Child2 : Base<Concrete2>
{
…
};
Concrete1 and Concrete2 classes are derived from a class called
ConcreteBase.
Now I need to create a list containing both Child1 and Child2 but the
following doesn't work.
std::list<Base<ConcreteBase> *> BaseList;
How can I create the above list?
Thanks for your replies.
Vikas
and Child2 as follows:
template <typename T>
class Base
{
…
};
class Child1 : Base<Concrete1>
{
…
};
class Child2 : Base<Concrete2>
{
…
};
Concrete1 and Concrete2 classes are derived from a class called
ConcreteBase.
Now I need to create a list containing both Child1 and Child2 but the
following doesn't work.
std::list<Base<ConcreteBase> *> BaseList;
How can I create the above list?
Thanks for your replies.
Vikas