You can nest parameters. That is, the parameter value can be parameterized.
template <typename X>
struct A
{
X t;
};
template <typename C>
struct B
{
C c;
};
int main()
{
B< A<int> > b;
return 0;
}
In this example, declaration bin main()creates a specialization Ausing intas a parameter, then creates a specialization busing A<int>as a parameter. Thus, by specialization b, Cthere is A<int>.
source
share