N
Nephi Immortal
I can create trait types with the fixed number of template parameters. How can I define different number of parameters in the same class name? I know that it is not legal, but can be done in trick.
enum E
{
eA,
eB
};
template< E e, typename T >
struct A
{
};
template< E e, typename T, typename T2 >
struct A
{
};
int main()
{
A< eA, long > a;
A< eB, short, long > a2;
return 0;
}
enum E
{
eA,
eB
};
template< E e, typename T >
struct A
{
};
template< E e, typename T, typename T2 >
struct A
{
};
int main()
{
A< eA, long > a;
A< eB, short, long > a2;
return 0;
}