This is my List class
template <typename Object>
class List {
public:
class iterator {
...
};
....
};
This is my function
template <typename Object>
void swapAdjacent(List<Object>::iterator & itrA, List<Object>::iterator & itrB) {
}
After compiling, turns out following error
error: variable or field 'swapAdjacent' declared void
Why it can't work?
If I change my code to following, it can be work
void swapAdjacent(List<int>::iterator & itrA, List<int>::iterator & itrB) {
}
I need help; why the first function can't work?