Uthpal Urubail escribió:
Joaquín, My question is: Can I define container like below? typedef multi_index_container< ElemShell*, indexed_by< //non-unique as some might have more than ids ordered_non_unique< composite_key< ElemShell*, member
, member , member , member > >, ordered_unique< member > > beambook;
Yes, you can (except that the second index seems to be wrongly keyed on GeneralElement rather than ElemShell, but I understand this is a typo.)
When I retrieve, beambook::iterator it=(pb.find(boost::make_tuple(obj->N1,obj->N2,obj->N3,node4))); int val = (*it)->N4; Application is crashing.
Almost surely because there's no element with the provided N1,N2,N3,N4 and hence the iteraror it is pb.end().
About: If you use ordered_unique then there cannot be two elements with the same node[0], node[1], node[2] values. Its TRUE. Two elements cannot have same node[0], node[1], node[2] values. How should be the container?
Use ordered_unique then, as your own statements imply. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo