我很难理解 Boost.MultiIndex 是如何实现的。可以说我有以下内容:
typedef multi_index_container<
employee,
indexed_by<
ordered_unique<member<employee, std::string, &employee::name> >,
ordered_unique<member<employee, int, &employee::age> >
>
> employee_set;
我想我有一个数组,Employee[]
,它实际上存储了employee
对象,还有两张地图
map<std::string, employee*>
map<int, employee*>
以姓名和年龄为键。每个映射都有employee*
指向数组中存储对象的值。这个可以吗?