【发布时间】:2012-10-10 07:08:27
【问题描述】:
我正在尝试向我的类添加一些 typedef,但编译器报告以下代码的语法错误:
template<class T>
class MyClass{
typedef std::vector<T> storageType; //this is fine
typedef storageType::iterator iterator; //the error is here
但下一个也不起作用:
typedef std::vector<T>::iterator iterator;
我在许多论坛上寻找答案,但找不到解决方案或解决方法。感谢您的帮助!
【问题讨论】:
标签: c++ templates vector typedef