下无法编译:
1 template<typename T>
2 void foo(std::vector<T>::iterator & i)
3 {
4 }
在Visual Studio中,我得到以下错误:
>(2) error C2065: 'i' : undeclared identifier
>(4) warning C4346: 'std::vector<_Tp>::iterator' : dependent name is not a type
prefix with 'typename' to indicate a type
>(4) error C2182: 'foo' : illegal use of type 'void'
>(4) error C2998: 'int foo' : cannot be a template definition
发现这个[复制](http://stackoverflow.com/questions/1301380/g-is-not-a-type-error) ,还有更多,但我找不到它们。 :S – GManNickG 2010-08-09 20:52:41