Re: [boost] [multi_index] composite keys: request for advice

----- Mensaje original ----- De: Jeremy Maitin-Shepard <jbms@attbi.com> Fecha: Sábado, Abril 24, 2004 11:13 pm Asunto: Re: [boost] [multi_index] composite keys: request for advice
Joaquin M Lopez Munoz <joaquin@tid.es> writes:
[snip: composite key system]
composite_key</* as before*> ck; ck(record(1,2,3))<=make_tuple(1,2); // yields true
This is not lexicographical order. According to lexicographical ordering:
(1, 2) < (1, 2, 3)
I did not claim that composite_key results and tuples are ordered lexicographically. What I said is that, given that a composite_key induces a lexicographical order on the elements of the multi_index_container it is used in, this can be taken advantage of to perform searches where only the first keys are given. For this to work, (1, 2) must be equivalent to (1,2,3) (meaning that !((1, 2)<(1,2,3)) and !((1,2,3)<(1,2)). I don't think there's any flaw with this approach, my doubt is about whether the fact that ck(record(1,2,3))<=make_tuple(1,2) and make_tuple(1,2)<=ck(record(1,2,3)) is reason enough to also make ck(record(1,2,3))==make_tuple(1,2) hold true. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo
participants (1)
-
JOAQUIN LOPEZ MU?Z