add lower_bound and upper_bound to slice to complement binary search #59301
Labels
C-feature-request
Category: A feature request, i.e: not implemented / a PR.
T-libs-api
Relevant to the library API team, which will review and decide on the PR/issue.
Uh oh!
There was an error while loading. Please reload this page.
In the case where we do a binary search on an iterator and have a lot of keys the same, I'd like to find the first key and the last key, rather than a random key (what
binary_search
currently returns).In c++ they have upper_bound and lower_bound, that will return the first and last of a block of duplicate keys.
Could we add these to slice too please ?
(and all that again for lower bound)
The text was updated successfully, but these errors were encountered: