
Joaquín M López Muñoz,
Thanks for offering me the help.
One interesting observation:
If I use the below in finding the objects it is not retrieving properly
indexed_by<
ordered_unique< /// INSTEAD if I use ordered_non_unique< it works fine
composite_key<
I am still not clear with my question:2
Can I define the container like below?
I don't want to create the temporary data structure. I will get these information from a class object. Can I use them directly??
Please help me in understanding.
typedef multi_index_container<
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
, member
, member
>
>,
ordered_unique<
member
>
>
beambook;
member
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]
No, in fact you don't need to create a Book object. Suppose bb is a beambook and you want to retrieve the mID of an element in bb with nodes n0, n1 and n2. You only have to do the following: size_t mID=bb.find(boost::make_tuple(n0,n1,n2))->mID; As you can see, you simply pass a tuple with the values for the composite key, not a whole Book object. Hope this helps, Joaquín M López Muñoz Telefónica, Investigación y Desarrollo _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users