<分区>
我有一个名为 assets
的 map 从 const 函数返回,我使用 const_iterator 来获取映射的子集,如下所示:
std::map<int, Asset>::const_iterator start = assets.begin();
start += 5;
......
但我得到错误:error: no match for ‘operator+=’ (operand types are ‘std::map<int, Asset>::const_iterator {aka std::_Rb_tree_const_iterator<std::pair<const int, Asset> >}’ and ‘int’)