N
Nico Massi
Hi NG!
I have a class A that should store a vector of pointers to objects of class
B.
But class B contains a template argument and each of the stored objects in
class A could have a different template argument. So i need a way to store
an array of template objects in a non-template class. Obviously this wont
work
cause a can`t tell the compiler which template argument to use.
So whats the usual way to solve such a situation?
The first solution that comes to my mind is, create a non-template base
interface to class B and store pointers to that base interface in A.
But i think this is not the best solution for that kind of problem.
I have a class A that should store a vector of pointers to objects of class
B.
But class B contains a template argument and each of the stored objects in
class A could have a different template argument. So i need a way to store
an array of template objects in a non-template class. Obviously this wont
work
cause a can`t tell the compiler which template argument to use.
So whats the usual way to solve such a situation?
The first solution that comes to my mind is, create a non-template base
interface to class B and store pointers to that base interface in A.
But i think this is not the best solution for that kind of problem.