J
Jaap
Hi all,
I'm looking for functionality very similar to std::map::lower_bound:
I'd like to find the first element whose key is equal to or smaller
than the key I pass.
In a map filled like this:
map[10] = 10;
map[20] = 20;
map[30] = 30;
foo being a function yielding an iterator to an element from map, I'd
like foo to do the following:
foo(map, 10)->first == 10
foo(map, 15)->first == 10
foo(map, 22)->first == 20
Obviously, I'd like foo() to have performance similar to lower_bound,
if at all possible.
Does anyone here know of such a beast ?
Thanks a lot,
JJ
I'm looking for functionality very similar to std::map::lower_bound:
I'd like to find the first element whose key is equal to or smaller
than the key I pass.
In a map filled like this:
map[10] = 10;
map[20] = 20;
map[30] = 30;
foo being a function yielding an iterator to an element from map, I'd
like foo to do the following:
foo(map, 10)->first == 10
foo(map, 15)->first == 10
foo(map, 22)->first == 20
Obviously, I'd like foo() to have performance similar to lower_bound,
if at all possible.
Does anyone here know of such a beast ?
Thanks a lot,
JJ