Hacker News new | ask | show | jobs
by cleancoder0 1567 days ago
I believe half-open intervals is something C++ uses for std::lower_bound and std::upper_bound.
2 comments

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.
Half-open intervals are very common because they overlap perfectly.