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