While (as the other answer says) you can give std::lower_bound
a comparator with two different parameter types (as value
is always the second parameter), in those cases I find it less confusing to use std::partition_point
.
std::partition_point
does the same thing, but uses an unary predicate and doesn't have a value
parameter:
chunk_id id = ...;auto iter = std::partition_point(a, b, [&](const chunk_offset &o){return o.chunk_id < id;});