比如函数:
template<class T>
void F(const std::vector<T>& vt, std::vector<T>::const_iterator beg, std::vector<T>::const_iterator end);
这个在编译时会显示错误:std::vector<T>::const_iterator 是未知类型
此时只要在 std::vector<T>::const_iterator 前面加上 typename 就行了:
template<class T>
void F(const std::vector<T>& vt, typename std::vector<T>::const_iterator beg, typename std::vector<T>::const_iterator end);
详情见:
http://www.cnblogs.com/dongzhiquan/p/4050997.html
http://blog.youkuaiyun.com/zhyh1435589631/article/details/62236363