Re: [Boost-users] [Multi-Index] composite_key problems

----- Mensaje original -----
De: Andreas Volz
The questions seems to by stupic, but how could I access the data looked up by B alone? What should I assign to the left?
??? = es.get<1>().find(b);
An iterator or what else?
This returns an iterator, yep. Please notice that es.get<1>() returns a reference to an index, which is, in many respects, entirely similar to a regular std::set. So you have find(), equal_range() etc. just like in the STL case, with equivalent syntax and semantics. You might want to give the Boost.MultiIndex tutorial a further read --anyway, don't hesitate to come back here if things aren't still clearer. Joaquin M Lopez Muñoz Telefonica, Investigacion y Desarrollo

Am Mon, 31 Oct 2005 22:57:22 +0100 schrieb JOAQUIN LOPEZ MU?Z:
??? = es.get<1>().find(b);
An iterator or what else?
This returns an iterator, yep. Please notice that
es.get<1>()
returns a reference to an index, which is, in many respects, entirely similar to a regular std::set. So you have find(), equal_range() etc. just like in the STL case, with equivalent syntax and semantics. You might want to give the Boost.MultiIndex tutorial a further read --anyway, don't hesitate to come back here if things aren't still clearer.
I got it working! Perhaps I've some more questions, but for now I could continue my work. Did someone create a SQL language wrapper around multi_index? I think this could be a very great feature. People that know SQL could really easy use it without learning too much other stuff. I thought about using a lightweight SQL lib (e.g. sqlite) before I found multi_index. But I don't save my data into a file, so multi_index fits perfect. regards Andreas
participants (2)
-
Andreas Volz
-
JOAQUIN LOPEZ MU?Z