Template Parameter
In this lesson, we will discuss template parameters.
We'll cover the following...
We'll cover the following...
Template Parameter
Every template is parametrized by one or more template parameters, indicated in the parameter-list of the template.
C++ supports three different kinds of template parameter:
1. Type parameter
std::vector<int> vec = {1, 2, 3, 4, 5};
2. Non-type parameter
std::array<int, 5> arr = {1, 2, 3, 4, 5};
3. Template-template Parameter
template <typename T, template <typename, typename> class Cont>
class Matrix{ ...
Matrix<int, std::vector> myIntVec;
Types
Type parameters are of class types and fundamental types. ...