Hi, I want to write a C++ template like this:
template <class Type1, class Type2, class Type3,....>
class MyClass
{
//...
};
But, "the number of types" is variable.
For example, a user can create an object with 3 types:
MyClass<int, int, int> obj;
or he can create an object with 5 types:
MyClass<int, int, int, int, int> obj;
In other words, I want the user :
1.Indicate the number of fields.
2.Set the types according to the number of fields.
how could I do this?
Thanks in advance.