[multi_index] looking for "equal_to and less than"

hi, I've got a structure like this, struct peer { int md5_; // unique key. int rank_; int degrees_; }; now, I need a composite_key, it can find equal_to "md5" and less than "rank_" and "degrees_" less than 8. eg: md5 rank degrees 2 0 8 2 1 5 2 2 0 2 6 3 4 3 1 4 5 0 f(2, 2) return (2 1 5) f(2, 1) return null f(2, 6) return (2 2 0)(2 1 5) f(4, 5) return (4 3 1) Thanks. -- View this message in context: http://old.nabble.com/-multi_index--looking-for-%22equal_to-and-less-than%22... Sent from the Boost - Users mailing list archive at Nabble.com.

isjk escribió:
hi,
I've got a structure like this, struct peer { int md5_; // unique key. int rank_; int degrees_; };
now, I need a composite_key, it can find equal_to "md5" and less than "rank_" and "degrees_" less than 8.
You can't directly do that with a composite key. There's two alternatives:
* Have your composite key defined on (md5_,rank_) (in this order),
do a lower_bound on (md5_value,rank_value), which gives you
the elements with md5_==md5_value and rank_
participants (2)
-
isjk
-
joaquin@tid.es