【发布时间】:2016-12-02 10:33:34
【问题描述】:
我的代码(不是我写的)使用多索引容器。
typedef boost::multi_index_container<
Block*,
boost::multi_index::indexed_by<
boost::multi_index::random_access<>,
boost::multi_index::ordered_non_unique<BOOST_MULTI_INDEX_MEMBER(Block,uint,pages_invalid) >
>
> active_set;
typedef active_set::nth_index<0>::type ActiveBySeq;
typedef active_set::nth_index<1>::type ActiveByCost;
active_set active_cost;
“块”是一类。
这个容器被用作优先队列。
ActiveByCost::iterator it = active_cost.get<1>().end();
--it;
我想搜索具有变量 A=="特定值" 的成员。 (不适用于优先队列)
A是Class Block的成员变量之一。
有什么办法吗?
【问题讨论】:
标签: c++ boost multi-index