I was reading about "template template parameters" and when i try this code out it results in compiler error, can anyone help me out ?
Code:
#include <cstdio>
#include <list>
#include <vector>
#include <string>
using namespace std;
template<template<typename T> class containerType>
class Container
{
containerType < int > intC;
};
int main()
{
Container<vector>vC;
return 0;
}
Compile Error:
Code:
templates.cpp: In function ‘int main()’:
templates.cpp:15: error: type/value mismatch at argument 1 in template parameter list for ‘template<template<class T> class containerType> class Container’
templates.cpp:15: error: expected a template of type ‘template<class T> class containerType’, got ‘template<class _Tp, class _Alloc> class std::vector’
templates.cpp:15: error: invalid type in declaration before ‘;’ token