我有一个boost :: multiIndex容器。说:
typedef boost::multi_index<....
> OrderSet;
OrderSet orderSet_;
int main()
{
const auto it = orderSet_.get<0>().equal_range(boost::make_tuple(/* Some Values*/))
if(it.first != it.second)
while(it.second != it.first) { /* Somethings to do */;
--it.second;
}
}
Run Code Online (Sandbox Code Playgroud)
程序因offset_ptr错误而崩溃。该程序it具有递增顺序的价值。所以我想先获得最高的价值,然后再下去..是这样的boost::equal_range(..., [&](const auto a, const auto b)-> decltype bool{return a > b;});
东西的重载功能吗?它像reverse_iterator的equal_range()
更新:一个生产者和许多消费者都可以访问多索引容器。当消费者找到equal_range时,生产者添加或删除元素,消费者抛出错误...这仅在我反向迭代时发生...