template class

Oct 27, 2012 at 10:01pm
Hi, I created a template class with two template parameter.
1
2
3
4
5
6

template<class T, class Y>
class Test
{
//...
};


In my main I want to pass a vector with the class such as
 
Test<string,vector<string>tester> h; //Error here 


Its basically map I have to implement.
Last edited on Oct 27, 2012 at 10:02pm
Oct 27, 2012 at 10:18pm
Is this this what you want?
Test<string,vector<string>> tester;
Oct 28, 2012 at 3:20am
From what I can tell it looks like you're trying to pass an object through a template type. Those are for types, not parameters. Pass objects through constructors.

If Peter's answer is what you want, not that it's only valid for C++11 and otherwise you need Test<string,vector<string> > tester;
Topic archived. No new replies allowed.