Suppose I have a template class such as:
template <class type, size>
class myTemplate
and I had an abstract base class:
class myDataType
and various derived classes
class subDataType1 : public myDataType
class subDataType2 : public myDataType
...
class subDataTypeN : public myDataType
What I WANT to do, is call:
myTemplate<myDataType, size> myObject;
However, this obviously doesn't work, because inside the template, I would be instantiating an object of an abstract class. Basically, I want the template to work with either of my derived classes, but I don't know how to mechanize this (coming from Java where "solutions" or workarounds such as type wildcards and "Object", for example, may have allowed me to at least get past the compiler's checks).
What I really want, is without altering my template class, allow multiple data types without instantiating multiple objects of my template class.
I should mention that I'm aware that the solution to this likely involves a call such as:
myTemplate<myDataType*, size> myObject
But I'll likely need more details than that, as I'm new to C++ (I don't know what I don't know).