Friday, October 10, 2008

c++: template template parameters

Template template parameter allows to pass not complete template as a template parameter. Sounds like tongue twister. I hope an example below should demonstrate the usage of template template parameter

#include <vector>
template<typename T, template<typename T> class V>
class C
{
   V<T> v;
};
int main(int argc, char **argv)
{
   C<int,std::vector> c;
   return 0;
}

No comments: