I'm using boost::multi_index_container
and I'm trying to refer to a member of a member in a template argument, but it's unclear how to do this:
struct Foo {
int unique_value;
};
struct Bar {
Foo foo;
double non_unique_value;
};
// I want to refer to some_value in a template argument:
multi_index_container<Bar, boost::multi_index::indexed_by<
ordered_unique< member< Foo, int, &Bar::foo::unique_value > >, // this doesn't work
ordered_non_unique< member< Bar, double, &Bar::non_unique_value > > // this works
> >
How can I refer to unique_value
in the template argument? I understand why what I did doesn't work: I should be conveying that Foo
is a type that is a member of Bar
and be doing something more akin to Bar::Foo::some_value
, but it's unclear how I can specify this.