considering the example below:
template <typename T>
class Vector {
T* data;
public:
class Iterator {
T* i;
public:
Iterator& operator++();
};
};
if I want to implement the 'operator++' function, it makes sence I'ld write like this:
template <typename T>
Vector<T>::Iterator& Vector<T>::Iterator::operator++() {
i++;
return *this;
}
but then I'm getting those error lines:
error C2143: syntax error : missing ';' before '&'
error C2065: 'T' : undeclared identifier
error C2923: 'Vector' : 'T' is not a valid template type argument for parameter 'T'
Why does it happen? and what should I do to solve this?
Thanks a lot.