The xtd::ranges::views::order_by_view class is used to sort the elements of a sequence in ascending order according to a key.
- Definition
The xtd::ranges::views::order_by_view class is used to sort the elements of a sequence in ascending o...
Definition order_by_view.hpp:44
- Header
#include <xtd/ranges/views/order_by_view>
- Namespace
- xtd::ranges::views
- Library
- xtd.core
- Examples
- The following example shows how to use xtd::ranges::views::order_by instance :
#include <xtd/xtd>
auto main() -> int {
auto numbers =
array {2, 7, 3, 1, 4, 10, 5, 6, 8, 9};
}
Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the ba...
Definition array.hpp:63
static void write_line()
Writes the current line terminator to the standard output stream using the specified format informati...
constexpr auto order_by
The xtd::ranges::views::order_by instance.
Definition order_by.hpp:40
@ n
The N key.
Definition console_key.hpp:114
The following example shows how to use xtd::ranges::views::order_by_view class : #include <xtd/xtd>
auto main() -> int {
auto numbers =
array {2, 7, 3, 1, 4, 10, 5, 6, 8, 9};
}
|
template<std::ranges::range range_t, typename key_selector_t> |
auto | operator() (range_t &&source, const key_selector_t &key_selector) const |
| Sorts the elements of a sequence in ascending order according to a key.
|
|
template<typename key_selector_t> |
auto | operator() (const key_selector_t &key_selector) const |
| Sorts the elements of a sequence in ascending order according to a key.
|
|
◆ operator()() [1/2]
template<std::ranges::range range_t, typename key_selector_t>
auto xtd::ranges::views::order_by_view::operator() |
( |
range_t && | source, |
|
|
const key_selector_t & | key_selector ) const |
|
inline |
Sorts the elements of a sequence in ascending order according to a key.
- Template Parameters
-
range_t | The type of the elements of source. |
- Parameters
-
source | A sequence of values to sort. |
key_selector | A function to extract a key from an element. |
◆ operator()() [2/2]
template<typename key_selector_t>
auto xtd::ranges::views::order_by_view::operator() |
( |
const key_selector_t & | key_selector | ) |
const |
|
inline |
Sorts the elements of a sequence in ascending order according to a key.
- Template Parameters
-
range_t | The type of the elements of source. |
- Parameters
-
key_selector | A function to extract a key from an element. |
The documentation for this class was generated from the following file: