1#ifndef CODEX_SORT_SELECTION_H
2#define CODEX_SORT_SELECTION_H
9template<std::input_iterator I, std::sentinel_for<I> S>
11 if constexpr(!std::random_access_iterator<I>)
13 else if constexpr(!std::random_access_iterator<S>)
19template<std::input_iterator I, std::sentinel_for<I> S>
21 constexpr bool fwd = std::forward_iterator<I>;
26 for(
auto i = std::next(ret); i != e; ++i) {
28 assert(std::min_element(
b, i) == ret);
32 assert(
b <= ret && ret < e);
38template<std::permutable I, std::sentinel_for<I> S>
41 for(
auto i =
b; i != e; ++i) {
42 assert(std::is_sorted(
b, i));
45 assert(std::is_partitioned(
46 b, e, [i](
const auto &
x) {
return x < *i; }));
48 assert(std::is_sorted(
b, e));
static const struct board b
Definition chess0.c:57
#define x
Definition gcc14.c:1
constexpr I min_element(I b, S e)
Definition selection.hpp:20
constexpr void selection_sort(I b, S e)
Definition selection.hpp:39
constexpr bool is_range(I b, S e)
Definition selection.hpp:10
#define m(a)
Definition std2.c:8
Definition reflexpr.cpp:168
constexpr bool is_min_element(I b, S e, const auto &x)
Definition utils.hpp:35