1#ifndef CODEX_SORT_INSERTION_H
2#define CODEX_SORT_INSERTION_H
9template<std::permutable I, std::sentinel_for<I> S>
10requires std::bidirectional_iterator<I>
12 for(
auto i =
b; i != e; ++i) {
13 assert(std::is_sorted(
b, i));
14 for(
auto p = i, np = std::prev(i);
p !=
b && *
p < *np;
p = np--) {
15 assert(std::is_sorted(
b,
p));
16 assert(std::is_sorted(
p, i));
17 std::iter_swap(np,
p);
20 assert(std::is_sorted(
b, e));
void insertion_sort(I b, S e)
Definition insertion.hpp:11
#define p()
Definition std2.c:11
Definition reflexpr.cpp:168