Hi
I am looking for a composite key container.
Though I found multi_index_container for composite key is
the best I have few doubts in its use case:
Question:01
class Book
{
public:
size_t mID;
size_t
node[3];
};
How to add the below into multi_index_container?
typedef
multi_index_container<
Book,
indexed_by<
ordered_unique<
composite_key<
Book,
member<Book,size_t,&Book::node[0]>,
member<Book,size_t,&Book::node[1]>,
member<Book,size_t,&Book::node[2]>
>
>,
ordered_unique<
member<Book,size_t,&Book::mID>
>
>
>
beambook;
Question:02
My requirement is straight forward. I need to get the id
by providing 3 nodes.
Should I always need to create a data structure? [class
Book]
Can’t I have something like below?
typedef
multi_index_container<
size_t,
indexed_by<
ordered_unique<
composite_key<
size_t, size_t, size_t
>
>,
ordered_unique<
size_t
>
>
>
beambook;
Thanks,
UJ