tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
sort.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2
3#ifndef TETL_ALGORITHM_SORT_HPP
4#define TETL_ALGORITHM_SORT_HPP
5
7
8namespace etl {
9
12
17template <typename RandomIt, typename Compare>
18constexpr auto sort(RandomIt first, RandomIt last, Compare comp) -> void
19{
20 etl::gnome_sort(first, last, comp);
21}
22
23template <typename RandomIt>
24constexpr auto sort(RandomIt first, RandomIt last) -> void
25{
26 etl::sort(first, last, etl::less());
27}
28
30
31} // namespace etl
32
33#endif // TETL_ALGORITHM_SORT_HPP
constexpr auto 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 sort.hpp:18
constexpr auto gnome_sort(BidirIt first, BidirIt last, Compare comp) -> void
Sorts the elements in the range [first, last) in non-descending order.
Definition gnome_sort.hpp:17
Definition adjacent_find.hpp:8
Function object for performing comparisons. Unless specialised, invokes operator< on type T....
Definition less.hpp:14