【发布时间】:2012-01-06 02:02:06
【问题描述】:
我有以下情况
typedef std::array<std::array<string,9>,9>candidates;
std::vector<candidates>cand;
我需要在递归深度中遍历字符串,并且即使重新调整大小也希望它们保持不变。我该怎么做?我以前使用的迭代器在重新调整大小时失效我想要一种解决方法.. 这是以前的尝试。
for(itr[d] = cand[d][i][j].begin(); itr[d] !=cand[d][i][j].end(); ++itr[d])
{
//if condition met - proceed to recursive call
//else reset (using ppp and push) and proceed to next element of string
}
【问题讨论】:
-
您收到的错误信息是什么?你能给出一个最小的测试用例吗?我的编译器(g++4.5.2)没有抱怨。
标签: c++ arrays string iterator