【发布时间】:2015-07-02 22:24:58
【问题描述】:
我被困在尝试冒泡排序 vector<vector<string>> vvs
如果运行像
for ( auto x : vvs )
其中包含类似
if ( x.at(pos) == (*need next x position*).at(pos) {
//perform sort and swap if needed
}
是否可以获得基于范围的循环的下一个位置?
【问题讨论】:
-
回答了这个问题。我想我会回去使用基于迭代器的循环。