The xtd::ranges::views::where_view class is used to filter elements from a sequence.
- Definition
The xtd::ranges::views::where_view class is used to filter elements from a sequence.
Definition where_view.hpp:44
- Header
#include <xtd/ranges/views/where_view>
- Namespace
- xtd::ranges::views
- Library
- xtd.core
- Examples
- The following example shows how to use xtd::ranges::views::where instance :
#include <xtd/xtd>
auto main() -> int {
auto numbers =
array {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
}
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 where
The xtd::ranges::views::where instance.
Definition where.hpp:40
@ n
The N key.
Definition console_key.hpp:114
The following example shows how to use xtd::ranges::views::where_view class : #include <xtd/xtd>
auto main() -> int {
auto numbers =
array {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
}
|
template<std::ranges::range range_t, typename predicate_t> |
auto | operator() (range_t &&source, const predicate_t &predicate) const |
| Filters a sequence of values based on a predicate.
|
|
template<typename predicate_t> |
auto | operator() (const predicate_t &predicate) const |
| Filters a sequence of values based on a predicate.
|
|
◆ operator()() [1/2]
template<std::ranges::range range_t, typename predicate_t>
auto xtd::ranges::views::where_view::operator() |
( |
range_t && | source, |
|
|
const predicate_t & | predicate ) const |
|
inline |
Filters a sequence of values based on a predicate.
- Template Parameters
-
range_t | The type of the elements of source. |
- Parameters
-
source | A sequence of values to filter. |
predicate | A function to test each element for a condition. |
◆ operator()() [2/2]
template<typename predicate_t>
auto xtd::ranges::views::where_view::operator() |
( |
const predicate_t & | predicate | ) |
const |
|
inline |
Filters a sequence of values based on a predicate.
- Template Parameters
-
range_t | The type of the elements of source. |
- Parameters
-
predicate | A function to test each element for a condition. |
The documentation for this class was generated from the following file: