A
aryan
I need to iterate thru a vector which holds an unknown type. I am
using templates and it looks like this after details are removed.
template <class T>
class set
{
vector<T> set_v;
public:
void insert(const T&);
};
template <class T>
void set<T>::insert(const T &t)
{
vector<T>::iterator itr; //This line does not
compile. error: expected `;' before "itr"
//......
//......
};
Pls let me know what i am doing wrong.
using templates and it looks like this after details are removed.
template <class T>
class set
{
vector<T> set_v;
public:
void insert(const T&);
};
template <class T>
void set<T>::insert(const T &t)
{
vector<T>::iterator itr; //This line does not
compile. error: expected `;' before "itr"
//......
//......
};
Pls let me know what i am doing wrong.