I have the following C++ code:
template<typename T>
T processVector(const std::vector<T>& input){
for(std::vector<T>::const_iterator it=input.begin();it!=input.end();it++){
//process vector
}
}
However, I get the following error upon compilation:
listOfVectors.cpp:6: error: expected `;' before ‘it’
listOfVectors.cpp:6: error: ‘it’ was not declared in this scope
I have been pondering over it for quite a while but can't make out why I am getting this error. I also tried clang to see if I can make anything out of its error statement but couldn't. Would appreciate the help. Thanks