我正在尝试使用 Boost multi_index 解决问题。如果我有2个结构如下:
struct MyStruct1
{
int x;
int y;
};
struct MyStruct2
{
int a;
MyStruct1 b;
};
如何使用 MyStruct2::bx 定义索引?这可能吗?
正在尝试类似的东西:
struct xIndex{};
typedef multi_index_container<
MyStruct2,
indexed_by<
ordered_unique<
tag<xIndex>,
member<MyStruct2, int, &MyStruct2::a::x>
>
>
> MyContainer;
但这不起作用。
感谢您提供任何信息/建议。