tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
stable_sort.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2
3#ifndef TETL_ALGORITHM_STABLE_SORT_HPP
4#define TETL_ALGORITHM_STABLE_SORT_HPP
5
8
9namespace etl {
10
13
19template <typename RandomIt, typename Compare>
20constexpr auto stable_sort(RandomIt first, RandomIt last, Compare comp) -> void
21{
22 etl::insertion_sort(first, last, comp);
23}
24
25template <typename RandomIt>
26constexpr auto stable_sort(RandomIt first, RandomIt last) -> void
27{
28 etl::stable_sort(first, last, etl::less());
29}
30
32
33} // namespace etl
34
35#endif // TETL_ALGORITHM_STABLE_SORT_HPP
constexpr auto insertion_sort(RandomIt first, RandomIt last, Compare comp) -> void
Sorts the elements in the range [first, last) in non-descending order. The order of equal elements is...
Definition insertion_sort.hpp:19
constexpr auto stable_sort(RandomIt first, RandomIt last, Compare comp) -> void
Sorts the elements in the range [first, last) in non-descending order. The order of equivalent elemen...
Definition stable_sort.hpp:20
Definition adjacent_find.hpp:8
Function object for performing comparisons. Unless specialised, invokes operator< on type T....
Definition less.hpp:14