3#ifndef TETL_ALGORITHM_EXCHANGE_SORT_HPP
4#define TETL_ALGORITHM_EXCHANGE_SORT_HPP
17template <
typename RandomIt,
typename Compare>
18constexpr auto exchange_sort(RandomIt first, RandomIt last, Compare comp) ->
void
20 for (
auto i = first; i <
etl::prev(last); ++i) {
21 for (
auto j =
etl::next(i); j < last; ++j) {
33template <
typename RandomIt>
constexpr auto exchange_sort(RandomIt first, RandomIt last, Compare comp) -> void
Sorts the elements in the range [first, last) in non-descending order.
Definition exchange_sort.hpp:18
constexpr auto iter_swap(ForwardIt1 a, ForwardIt2 b) -> void
Swaps the values of the elements the given iterators are pointing to.
Definition iter_swap.hpp:19
constexpr auto prev(BidirIt it, typename iterator_traits< BidirIt >::difference_type n=1) -> BidirIt
Return the nth predecessor of iterator it.
Definition prev.hpp:14
constexpr auto next(InputIt it, typename iterator_traits< InputIt >::difference_type n=1) -> InputIt
Return the nth successor of iterator it.
Definition next.hpp:14
Definition adjacent_find.hpp:8
Function object for performing comparisons. Unless specialised, invokes operator< on type T....
Definition less.hpp:14