let's say I have a template class:
Code:
template<class T>
class MyTemplate
{
public:
MyTemplate() { }
~MyTemplate() { }
private:
T* t;
};
and two other classes, whose constructors take different numbers of parameters:
Code:
class A
{
public:
A(int arg1, int arg2) { }
};
class B
{
public:
B(int arg1, int arg2, int arg3, int arg4) { }
};
is there a way that I can do the following:
Code:
MyTemplate<A>* a = new MyTemplate<A>(1, 2);
MyTemplate<B>* b = new MyTemplate<B>(1, 2, 3, 4);
it seems like I've seen this done somewhere before, but I'm not 100% sure.