Boost logo

Boost Users :

Subject: [Boost-users] [multi-index] looking for "not greater than"
From: Igor R (boost.lists_at_[hidden])
Date: 2010-06-23 07:48:43


Hello,

I've got a container with an ordered non-unique key. I have to find an
element, which is not greater than X.

[1, 3, 3, 5, 7]
myIndex.not_greater_than(4) --> 5
myIndex.not_greatet_than(7) --> 7
myIndex.not_greatet_than(8) --> 7

IUUC, neither lower_bound(), nor upper_bound() can help here.
Is there a simple way to do this?

Thanks.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net