Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
cleancoder0
· 4y ago · 0 comments
I believe half-open intervals is something C++ uses for std::lower_bound and std::upper_bound.
Comments
[–]
mark-r
4y ago
Using half-open intervals for std::lower_bound and std::upper_bound has an unexpected benefit. It allows the functions to return an insertion point that keeps the sequence sorted, even if that insertion point is at the end of the sequence.
[–]
thaumasiotes
4y ago
Half-open intervals are very common because they overlap perfectly.