I am trying to solve an issue using Boost multi_index. If I have 2 structures as follows:
struct MyStruct1
{
int x;
int y;
};
struct MyStruct2
{
int a;
MyStruct1 b;
};
How would I define an index using MyStruct2::b.x? Is this possible?
was trying something like:
struct xIndex{};
typedef multi_index_container<
MyStruct2,
indexed_by<
ordered_unique<
tag<xIndex>,
member<MyStruct2, int, &MyStruct2::a::x>
>
>
> MyContainer;
But that doesn't work.
Thanks for any info/advice.