O_o
You have used 'T1' as part of an argument to the 'c' template in the specification of the specialization. No 'T1' symbol is in scope.
You have not used 'T3' as part of an argument to the 'c' template in the specification of the specialization. You must use ever parameter as part of the specialization.
Your example is wrong on two places. I'm not sure what you may have intended. I can't say if you understood or not.
I'll write another example. (I'm writing inline so there may be a syntax bug.)
Soma
Code:
#include <iostream>
template
<
unsigned int a_F,
unsigned int b_F,
unsigned int c_F,
unsigned int d_F,
unsigned int e_F,
unsigned int f_F,
unsigned int g_F
>
struct tester
{
};
template
<
typename type1_F,
typename type2_F
> // original template has two formal parameters
struct test
{
test()
{
std::cout << "default" << '\n';
}
};
template
<
typename type_F
> // specialized template has one formal parameters
// specialization "passes" two arguments to the original
struct test<type_F, type_F>
{
test()
{
std::cout << "small specialization" << '\n';
}
};
template
<
typename type_F,
unsigned int a_F,
unsigned int b_F,
unsigned int c_F,
unsigned int d_F,
unsigned int e_F,
unsigned int f_F,
unsigned int g_F
> // specialized template has eight formal parameters
// specialization "passes" two arguments to the original
struct test<type_F, tester<a_F, b_F, c_F, d_F, e_F, f_F, g_F> >
{
test()
{
std::cout << "big specialization" << '\n';
}
};
int main()
{
typedef unsigned long whatever;
typedef whatever * not_whatever;
test<whatever, not_whatever> a;
test<whatever, whatever> b;
test<whatever, tester<0, 1, 2, 3, 4, 5, 6> > c;
return(0);
}