Template Class & Vectors

Hey, here is what I'm trying to do:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

template <class T>
class ListItem {

    public:

    string label;
    T data;

};

...

int populateListBox(vector<ListItem> items){
  //Do Something
}


Error: type/value mismatch at argument 1 in template parameter list for `template<class _Tp, class _Alloc> class std::vector'|

Haha is it even possible to do this?

Any help would be greatly appreciated!

Nick.
ListItem is a template.

vector< ListItem<int> >

would work, for example.

(you have to specify ListItem's template type)
Topic archived. No new replies allowed.