30#ifndef __ADS_InsertionSort
31 #define __ADS_InsertionSort
76 class T = std::ranges::range_value_t< std::remove_cvref_t< Store > > ,
77 class C = std::less<> >
82template<
class T ,
class C = std::less<> >
83void insertionSort( std::vector< T > & A , std::size_t lo , std::size_t hi ,
107 class T = std::ranges::range_value_t< std::remove_cvref_t< Store > > ,
108 class C = std::less<> >
112template<
class T ,
class C = std::less<> >
124 class T = std::ranges::range_value_t< std::remove_cvref_t< Store > > ,
125 class C = std::less<> >
129template<
class T ,
class C = std::less<> >
141 requires requires( std::vector< std::ranges::range_value_t< R > > & v ,
148 const auto f = [ & ](
auto & v ) ->
decltype(
auto ) {
151 return( detail::sortRange( A , f , f ) );
158template< SortRange R ,
class... P >
159 requires requires( std::vector< std::ranges::range_value_t< R > > & v ,
166 const auto f = [ & ](
auto & v ) ->
decltype(
auto ) {
169 return( detail::sortRange( A , f , f ) );
180#include "ADS/sort/impl/InsertionSort.tpp"
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
The checks of the contracts of the sorts [see Contract.h]: a copy of the input kept only when the aud...
the storage on which the sorts of the book work in place, which read the items by their ranks only: a...
Definition Sorted.h:184
a range that the sorts take beside std::vector and std::span: random access, sized,...
Definition Sorted.h:153
void insertionSort(Store &&A, std::size_t lo, std::size_t hi, C less=C())
the insertion sort of
void insertionSortSentinel(Store &&A, C less=C())
the insertion sort with a sentinel: the minimum first goes to , with comparisons and one swap,...