auto res = *ranges::partition_point(views::iota(lo, hi), check);
this returns the first $$$x$$$ in the range $$$[lo, hi)$$$ such that check(x) is not true, or $$$hi$$$ if it doesn't exist. Be careful to make sure the $$$lo$$$ and $$$hi$$$ are both integers of the same type, otherwise there is weird behavior.
example usage: 284450329








well known
I didn't know it and am thankful for the blog poster sharing it :O
It might be convenient for some of us,but not necessary.In fact,a simple binary search is easy to write.
You might wonder whether this dereferences
end()when all values satisfycheck. It does, but forviews::iota(lo, hi),end()storeshi, and dereferencing that iterator returns the stored value.libstdc++ does the same:
end(),operator*.