tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
partial_sort.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2
3#ifndef TETL_ALGORITHM_PARTIAL_SORT_HPP
4#define TETL_ALGORITHM_PARTIAL_SORT_HPP
5
8
9namespace etl {
10
19template <typename RandomIt, typename Compare>
20constexpr auto partial_sort(RandomIt first, RandomIt middle, RandomIt last, Compare comp) -> void
21{
22 // TODO: Improve. Currently forwards to regular sort.
23 etl::ignore_unused(middle);
24 etl::sort(first, last, comp);
25}
26
27template <typename RandomIt>
28constexpr auto partial_sort(RandomIt first, RandomIt middle, RandomIt last) -> void
29{
30 etl::ignore_unused(middle);
31 etl::sort(first, last);
32}
33
34} // namespace etl
35
36#endif // TETL_ALGORITHM_PARTIAL_SORT_HPP
constexpr auto partial_sort(RandomIt first, RandomIt middle, RandomIt last, Compare comp) -> void
Rearranges elements such that the range [first, middle) contains the sorted middle - first smallest e...
Definition partial_sort.hpp:20
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
Definition adjacent_find.hpp:8
constexpr auto ignore_unused(Types &&...) -> void
Explicitly ignore arguments or variables.
Definition ignore_unused.hpp:17