implicit typename is deprecated
-
Hi why compile this method occurs warning! can the warnnings be disapper?
template void Fun() { vector vecTest; vector::iterator iter = vecTest.begin(); }
main.cpp: In function `void Fun()': main.cpp:10: warning: `typename std::vector >::iterator' is implicitly a typename main.cpp:10: warning: implicit typename is deprecated, please see the documentation for details please help me I love Programming -
Hi why compile this method occurs warning! can the warnnings be disapper?
template void Fun() { vector vecTest; vector::iterator iter = vecTest.begin(); }
main.cpp: In function `void Fun()': main.cpp:10: warning: `typename std::vector >::iterator' is implicitly a typename main.cpp:10: warning: implicit typename is deprecated, please see the documentation for details please help me I love Programming -
Hi why compile this method occurs warning! can the warnnings be disapper?
template void Fun() { vector vecTest; vector::iterator iter = vecTest.begin(); }
main.cpp: In function `void Fun()': main.cpp:10: warning: `typename std::vector >::iterator' is implicitly a typename main.cpp:10: warning: implicit typename is deprecated, please see the documentation for details please help me I love ProgrammingIf you were to check 'Do not treat <'s as HTML tags', your message would be readable :-) Christian Graus - Microsoft MVP - C++
-
Hi why compile this method occurs warning! can the warnnings be disapper?
template void Fun() { vector vecTest; vector::iterator iter = vecTest.begin(); }
main.cpp: In function `void Fun()': main.cpp:10: warning: `typename std::vector >::iterator' is implicitly a typename main.cpp:10: warning: implicit typename is deprecated, please see the documentation for details please help me I love ProgrammingYou need to write:
template<class T> void Fun() { vector<T> vecTest; typename vector<T>::iterator iter = vecTest.begin(); }
See also: C++ Templates FAQ[^]