1st_noiz ([info]1st_noiz) wrote,
@ 2009-10-30 17:24:00
Previous Entry  Add to memories!  Tell a Friend  Next Entry
C++ templates: type of the iterator is unknown until instantiation
template<class T> void addAllVector() {
   std::vector<T>::iterator it;

}

gcc error:
test.cpp:4: error: expected `;' before 'it'
test.cpp:5: error: 'it' was not declared in this scope

template<class T> void addAllVector() {
   typename std::vector<T>::iterator it;

}


Advertisement


(No comments)

Post a comment in response:

From:
Help
Identity URL: 
Username:
Password:
Don't have an account? Create one now.
Subject:
No HTML allowed in subject
   Help
Message:

 
Create an Account
Forgot your login or password?
Login w/ OpenID
English • Español • Deutsch • Русский…