On the line
set<T>::iterator iter;
I am getting "expected ';' before 'iter'"
#include <vector>
#include <set>
using namespace std;
template <typename T>
vector<T> UniqueElements(const vector<T> &V)
{
set<T> s;
s.insert(V.begin(), V.end());
vector<T> Elements;
set<T>::iterator iter;
return Elements;
}
Can anyone see why?
It compiles fine if I do
set<int>::iterator iter;
Thanks,
Dave