Description
Sometimes it's useful to pass templates as arguments to other templates. For example, suppose that you have some type of a data structure that you're designing, and want to use another container type such as vector or list to implement this structure. You would like to allow the user to specify the container type. This can be realized by specifying a template as an argument to another template.
To specify a template as a template parameter, you need to specify its required arguments. For example, in this declaration:
template <class T, template<class> class B> class A {...};the template A takes two arguments, one a type argument, and one a template argument for a template that itself takes a single type argument.
Concept
In the example C is a template that takes a type argument and a template argument. The type argument is an underlying type of element to be stored in a container, and the template argument is a container template type such as vector or list. The C template uses the arguments to implement some type of a data structure internally, with push() and top() operations defined on it.
Supported
Supported
Supported