Template Overloading
Jul 29, 2010 at 8:00pm UTC
Hi there,
I'm not sure the above is the correct term but is there anyway to overload a template class?
For example I want to do the below but it doesn't seem to like it...
1 2 3 4 5 6 7 8 9 10 11 12 13 14
template <typename T> class MyClass
{
// etc...
};
template <typename T, typename T2> class MyClass
{
// etc...
};
template <typename T1, typename T2, typename T3> class MyClass
{
// etc...
};
I basically need a way to have the same class but allow it to take a variable amount of arguments and types. Is this possible at all? Is it easy to implement?
Thank you for any help that is offered - it is always appreciated.
Regards,
Phil.
Jul 29, 2010 at 9:19pm UTC
Jul 30, 2010 at 5:06pm UTC
Thanks for the reply - the links were a great help.
Regards,
Phil.
Jul 30, 2010 at 6:29pm UTC
something like this?
1 2 3 4 5 6
template <typename T1, typename T2 = int , typename T3 = float > class MyClass
{
// etc...
};
Topic archived. No new replies allowed.