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::forward_iterator I, std::sentinel_for<I> S>
25 for(
auto i = std::next(ret); i != e; ++i) {
26 assert(std::min_element(
b, i) == ret);
30 assert(std::min_element(
b, e) == ret);
34template<std::permutable I, std::sentinel_for<I> S>
37 for(
auto i =
b; i != e; ++i) {
38 assert(std::is_sorted(
b, i));
40 assert(std::is_partitioned(
41 b, e, [i](
const auto &
x) {
return x < *i; }));
43 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
void check_range(I b, S e)
Definition selection.hpp:10
constexpr void selection_sort(I b, S e)
Definition selection.hpp:39
Definition reflexpr.cpp:168