21 template<
class Iterator,
class Comparator>
28 while (last != first) {
29 const auto diff = last - first;
30 Iterator mid = first + diff/2;
35 else if (comp == -1) {
43 if (first + 1 == mid) {
44 return (f(*first) == 1) ? first : mid;
Namespace for csl library.
Definition: abreviation.h:34
Bunch of functions that allow to do comparisons with Arbitrary expressions or expressions with dummy ...
Definition: comparison.h:115
Iterator dichotomyFindIf(Iterator first, Iterator last, Comparator &&f)
Template dichotomy algorithm using a comparator.
Definition: dichotomy.h:22