Typedef一个矢量迭代器

时间:2012-02-10 16:04:22

标签: c++ vector iterator typedef

每当我做

typedef std::vector< SomeType >::iterator

我收到错误:

error: wrong number of template arguments (1, should be 5)

这是为什么?是否可以输入定义c ++向量或向量迭代器?

1 个答案:

答案 0 :(得分:4)

这很好用:

typedef std::vector<std::string> string_vector;
typedef string_vector::iterator str_vect_itr;

我会仔细查看你的typedef ......