9template<std::random_access_iterator I, std::sentinel_for<I> S>
11 assert(std::is_sorted(
b, e));
12 [[maybe_unused]]
const I ib =
b;
13 [[maybe_unused]]
const S ie = e;
15 assert(ib <=
b &&
b <= e && e <= ie);
16 assert(std::find(ib,
b,
x) ==
b);
17 assert(
b == ib ||
b[-1] <
x);
18 assert(e == ie || !(*e <
x));
19 const I
m =
b +
static_cast<std::size_t
>(e -
b) / 2;
20 assert(
b <=
m &&
m < e);
26 assert(ib <=
b &&
b <= ie);
27 assert(
b == ie || !(*
b <
x));
28 assert(
b == ib ||
b[-1] <
x);
29 assert(
b == ie || *
b ==
x || std::find(ib, ie,
x) == ie);
33template<std::random_access_iterator I, std::sentinel_for<I> S>
36 return b != e && !(
x < *
b);
static const struct board b
Definition chess0.c:57
#define x
Definition gcc14.c:1
bool bsearch(I b, S e, const auto &x)
Definition bsearch.hpp:34
I lower_bound(I b, S e, const auto &x)
Definition bsearch.hpp:10
#define m(a)
Definition std2.c:8
Definition reflexpr.cpp:168