10#define __XTD_STD_INTERNAL__
12#undef __XTD_STD_INTERNAL__
13#define __XTD_CORE_INTERNAL__
17#undef __XTD_CORE_INTERNAL__
40template<
typename type_t>
41struct __opaque_xtd_linq_enumerable_collection__;
42template<
typename type_t,
typename param_t>
43struct __opaque_xtd_linq_lazy_enumerable__;
51 template<
typename type_t>
53 template<
typename type_t>
82 template<
typename type_t>
86 template<
typename type_t>
90 template<
typename type_t>
94 template<
typename type_t>
98 template<
typename key_t,
typename value_t>
113 template<xtd::iterable source_t, xtd::func_callable<xtd::iterable_value_type<source_t>, xtd::iterable_value_type<source_t>, xtd::iterable_value_type<source_t>> func_t>
125 template<
typename accumulate_t, xtd::iterable source_t, xtd::func_callable<accumulate_t, accumulate_t, xtd::iterable_value_type<source_t>> func_t>
126 [[nodiscard]]
static auto aggregate(source_t&& source, accumulate_t&& seed, func_t&&
func) -> accumulate_t;
139 template<
typename result_t,
typename accumulate_t, xtd::iterable source_t, xtd::func_callable<accumulate_t, accumulate_t, xtd::iterable_value_type<source_t>> func_t, xtd::func_callable<result_t, accumulate_t> result_selector_t>
140 [[nodiscard]]
static auto aggregate(source_t&& source, accumulate_t&& seed, func_t&&
func, result_selector_t&& result_selector) -> result_t;
150 template<xtd::iterable source_t, xtd::predicate_callable<xtd::iterable_value_type<source_t>> predicate_t>
151 [[nodiscard]]
static auto all(source_t&& source, predicate_t&&
predicate) -> bool;
161 template<xtd::iterable source_t>
162 [[nodiscard]]
static auto any(source_t&& source)
noexcept -> bool;
171 template<xtd::iterable source_t, xtd::predicate_callable<xtd::iterable_value_type<source_t>> predicate_t>
172 [[nodiscard]]
static auto any(source_t&& source, predicate_t&&
predicate) -> bool;
182 template<xtd::iterable source_t>
193 template<xtd::iterable source_t>
202 template<xtd::iterable source_t>
211 template<xtd::iterable source_t>
220 template<
typename value_t>
230 template<std::forward_iterator iterator_t>
240 template<std::forward_iterator iterator_t>
250 template<
typename value_t, xtd::usize length>
260 template<
typename value_t, xtd::usize length>
264 template<xtd::usize size_>
266 template<xtd::usize size_>
268 template<
typename value_t,
typename container_t>
270 template<
typename value_t,
typename container_t>
272 template<
typename value_t,
typename container_t>
274 template<
typename value_t,
typename container_t>
276 template<
typename value_t,
typename container_t>
278 template<
typename value_t,
typename container_t>
286 template<xtd::iterable source_t>
293 template<xtd::iterable source_t>
295 [[nodiscard]]
static auto average(source_t&& source) -> double;
300 template<xtd::iterable source_t>
307 template<xtd::iterable source_t>
309 [[nodiscard]]
static auto average(source_t&& source) -> double;
314 template<xtd::iterable source_t>
316 [[nodiscard]]
static auto average(source_t&& source) -> double;
321 template<xtd::iterable source_t>
327 template<xtd::iterable source_t>
333 template<xtd::iterable source_t>
339 template<xtd::iterable source_t>
345 template<xtd::iterable source_t>
356 template<
typename result_t, xtd::iterable source_t>
366 template<xtd::iterable source_t>
374 template<xtd::iterable first_t, xtd::iterable second_t>
382 template<xtd::iterable source_t>
390 template<xtd::iterable source_t>
398 template<xtd::iterable source_t, xtd::func_callable<
bool, xtd::iterable_value_type<source_t>, xtd::iterable_value_type<source_t>> equater_t>
408 template<xtd::iterable source_t>
418 template<xtd::iterable source_t, xtd::predicate_callable<xtd::iterable_value_type<source_t>> predicate_t>
425 template<xtd::iterable source_t>
437 template<
typename key_t, xtd::iterable source_t, xtd::callable<key_t, xtd::iterable_value_type<source_t>> key_selector_t>
449 template<
typename key_t, xtd::iterable source_t, xtd::callable<key_t, xtd::iterable_value_type<source_t>> key_selector_t>
462 template<
typename key_t, xtd::iterable source_t, xtd::callable<key_t, xtd::iterable_value_type<source_t>> key_selector_t, xtd::func_callable<
bool, key_t, key_t> key_equater_t>
472 template<xtd::iterable source_t>
482 template<xtd::iterable source_t>
489 template<xtd::iterable source_t>
495 template<xtd::iterable source_t>
502 template<xtd::iterable source_t, xtd::func_callable<
bool, xtd::iterable_value_type<source_t>, xtd::iterable_value_type<source_t>> equater_t>
510 template<xtd::iterable source_t>
518 template<xtd::iterable source_t, xtd::func_callable<
bool, xtd::iterable_value_type<source_t>> predicate_t>
527 template<xtd::iterable source_t, xtd::predicate_callable<xtd::iterable_value_type<source_t>> prediacte_t>
534 template<xtd::iterable source_t, xtd::predicate_callable<xtd::iterable_value_type<source_t>> prediacte_t>
541 template<xtd::iterable source_t>
547 template<xtd::iterable source_t>
559 template<xtd::iterable source_t>
560 [[nodiscard]]
static auto from(source_t&& source)
noexcept;
569 template<xtd::iterable source_t>
579 template<xtd::iterable source_t>
589 template<
typename value_t>
602 template<std::forward_iterator iterator_t>
613 template<std::forward_iterator iterator_t>
624 template<
typename value_t, xtd::usize length>
635 template<
typename value_t, xtd::usize length>
639 template<xtd::usize size_>
641 template<xtd::usize size_>
643 template<
typename value_t,
typename container_t>
645 template<
typename value_t,
typename container_t>
647 template<
typename value_t,
typename container_t>
649 template<
typename value_t,
typename container_t>
651 template<
typename value_t,
typename container_t>
653 template<
typename value_t,
typename container_t>
662 template<xtd::iterable source_t>
670 template<xtd::iterable source_t, xtd::func_callable<
bool, xtd::iterable_value_type<source_t>> predicate_t>
676 template<xtd::iterable source_t>
683 template<xtd::iterable source_t, xtd::callable<xtd::iterable_value_type<source_t>, xtd::iterable_value_type<source_t>> selector_t>
690 template<
typename result_t, xtd::iterable source_t, xtd::callable<result_t, xtd::iterable_value_type<source_t>> selector_t>
692 [[nodiscard]]
static auto max(source_t&& source, selector_t&& selector) -> result_t;
697 template<xtd::iterable source_t>
704 template<xtd::iterable source_t, xtd::callable<xtd::iterable_value_type<source_t>, xtd::iterable_value_type<source_t>> selector_t>
711 template<
typename result_t, xtd::iterable source_t, xtd::callable<result_t, xtd::iterable_value_type<source_t>> selector_t>
713 [[nodiscard]]
static auto min(source_t&& source, selector_t&& selector) -> result_t;
718 template<xtd::iterable source_t>
724 template<xtd::iterable source_t>
731 template<xtd::iterable source_t, xtd::func_callable<
bool, xtd::iterable_value_type<source_t>, xtd::iterable_value_type<source_t>> lesser_t>
741 template<
typename key_t, xtd::iterable source_t, xtd::callable<key_t, xtd::iterable_value_type<source_t>> key_selector_t>
751 template<xtd::iterable source_t, xtd::callable<xtd::iterable_value_type<source_t>, xtd::iterable_value_type<source_t>> key_selector_t>
761 template<
typename key_t, xtd::iterable source_t, xtd::callable<key_t, xtd::iterable_value_type<source_t>> key_selector_t>
771 template<xtd::iterable source_t, xtd::callable<xtd::iterable_value_type<source_t>, xtd::iterable_value_type<source_t>> key_selector_t>
781 template<xtd::
integer
integer_t>
791 template<xtd::
integer
integer_t>
799 template<xtd::
integer
integer_t>
809 template<
typename element_t>
824 template<xtd::iterable source_t>
836 template<xtd::iterable source_t>
848 template<xtd::iterable source_t>
849 [[nodiscard]] static auto select(source_t&& source, auto&& selector) -> xtd::collections::generic::enumerable_generator<xtd::raw_type<decltype(selector(xtd::iterable_value_type<source_t> {}, xtd::usize {}))>>;
856 template<xtd::iterable first_t, xtd::iterable second_t>
863 template<xtd::iterable first_t, xtd::iterable second_t>
870 template<xtd::iterable first_t, xtd::iterable second_t, xtd::func_callable<
bool, xtd::iterable_value_type<first_t>, xtd::iterable_value_type<second_t>> equality_comparer_t>
871 [[nodiscard]]
static auto sequence_equal(first_t&&
first, second_t&& second, equality_comparer_t&& comparer) -> bool;
877 template<xtd::forward_iterable source_t>
884 template<xtd::iterable source_t>
894 template<xtd::iterable source_t>
901 template<xtd::iterable source_t>
908 template<xtd::iterable source_t>
918 template<xtd::iterable source_t>
930 template<
typename source_t>
942 template<
typename source_t>
956 template<xtd::iterable source_t>
966 template<xtd::iterable first_t, xtd::iterable second_t>
976 template<xtd::iterable first_t, xtd::iterable second_t>
983 template<xtd::iterable first_t, xtd::iterable second_t, xtd::iterable third_t>
991 template<xtd::iterable first_t, xtd::iterable second_t, xtd::iterable third_t>
996 template<
typename type_t>
997 struct enumerable_holder {
998 enumerable_holder(
const type_t& value);
1000 enumerable_holder(type_t&& value)
requires std::movable<type_t>;
1009 template<typename...>
1010 static inline constexpr
bool always_false_v = false;
1012 template<typename predicate_t, typename value_t>
1013 [[nodiscard]] static constexpr auto invoke_predicate_with_optional_index(predicate_t&&
predicate, value_t&& value,
xtd::
usize index) ->
bool;
1015 template<typename result_t, typename selector_t, typename value_t>
1016 [[nodiscard]] static auto invoke_selector_with_optional_index(selector_t&& selector, value_t&& value,
xtd::
usize index) -> result_t;
Contains xtd::callable concept.
Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the ba...
Definition array.hpp:64
Represents an enumerable generator that supports deferred, lazy iteration over a collection of a spec...
Definition enumerable_generator.hpp:45
Exposes a method that compares two objects.
Definition icomparer.hpp:30
Exposes the enumerator, which supports a simple iteration over a collection of a specified type.
Definition ienumerable.hpp:40
Defines methods to support the comparison of objects for equality.
Definition iequality_comparer.hpp:34
Represents a strongly typed list of objects that can be accessed by index. Provides methods to search...
Definition list.hpp:84
Provides a set of static methods for querying objects that implement ienumerable <type_t>.
Definition enumerable_.hpp:76
static auto chunk(source_t &&source, xtd::usize size) -> xtd::collections::generic::enumerable_generator< xtd::array< xtd::iterable_value_type< source_t > > >
Splits the elements of a sequence into chunks of size at most size.
static auto order_by_descending(source_t &&source, key_selector_t &&key_selector) -> xtd::collections::generic::enumerable_generator< xtd::iterable_value_type< source_t > >
Sorts the elements of a sequence in descending order according to a key.
static auto last(source_t &&source) -> xtd::iterable_value_type< source_t >
Returns the last element of a sequence.
static auto order(source_t &&source, lesser_t &&lesser) -> xtd::collections::generic::enumerable_generator< xtd::iterable_value_type< source_t > >
Sorts the elements of a sequence in ascending order.
static auto zip(first_t &&first, second_t &&second, auto &&result_selector) -> xtd::collections::generic::enumerable_generator< xtd::raw_type< decltype(result_selector(xtd::iterable_value_type< first_t > {}, xtd::iterable_value_type< second_t > {}))> >
Applies a specified function to the corresponding elements of two sequences, producing a sequence of ...
static auto range(integer_t start, integer_t count) -> xtd::collections::generic::enumerable_generator< integer_t >
Generates a sequence of integral numbers within a specified range.
static auto sequence_equal(first_t &&first, second_t &&second) -> bool
Determines whether two sequences are equal by comparing the elements by using the default equality co...
static auto zip(first_t &&first, second_t &&second) -> xtd::collections::generic::enumerable_generator< std::tuple< xtd::iterable_value_type< first_t >, xtd::iterable_value_type< second_t > > >
Produces a sequence of tuples with elements from the two specified sequences.
static auto order_by(source_t &&source, key_selector_t &&key_selector) -> xtd::collections::generic::enumerable_generator< xtd::iterable_value_type< source_t > >
Sorts the elements of a sequence in ascending order according to a key.
static auto last(source_t &&source, predicate_t &&predicate) -> xtd::iterable_value_type< source_t >
Returns the last element in a sequence that satisfies a specified condition.
static auto skip_while(source_t &&source, auto &&predicate) -> xtd::collections::generic::enumerable_generator< xtd::iterable_value_type< source_t > >
Bypasses elements in a sequence as long as a specified condition is true and then returns the remaini...
static auto order_by_descending(source_t &&source, key_selector_t &&key_selector) -> xtd::collections::generic::enumerable_generator< xtd::iterable_value_type< source_t > >
Sorts the elements of a sequence in descending order according to a key.
static auto max(source_t &&source, selector_t &&selector) -> xtd::iterable_value_type< source_t >
Returns the maximum value in a sequence of xtd::numeric values.
typename xtd::collections::generic::ienumerable< type_t > ienumerable
Represents the ienumerable value type.
Definition enumerable_.hpp:91
typename xtd::collections::generic::enumerator< type_t > enumerator
Represents the enumerator value type.
Definition enumerable_.hpp:83
static auto sequence_equal(first_t &&first, second_t &&second, const iequality_comparer< xtd::iterable_value_type< first_t > > &comparer) -> bool
Determines whether two sequences are equal by comparing their elements by using a specifie the equali...
static auto distinct(source_t &&source) noexcept -> xtd::collections::generic::enumerable_generator< xtd::iterable_value_type< source_t > >
Returns distinct elements from a sequence by using the default equality comparer to compare values.
static auto from(std::initializer_list< value_t > source) noexcept -> xtd::collections::generic::enumerable_generator< value_t >
Returns the input typed as xtd::collections::generic::ienumerable <type_t>.
static auto concat(first_t &&first, second_t &&second) noexcept -> xtd::collections::generic::enumerable_generator< xtd::iterable_value_type< first_t > >
Concatenates two sequences.
static auto first_or_default(source_t &&source, prediacte_t &&predicate, xtd::iterable_value_type< source_t > &&default_value) noexcept -> xtd::iterable_value_type< source_t >
Returns the first element of the sequence that satisfies a condition, or a specified default value if...
typename xtd::collections::generic::iequality_comparer< type_t > iequality_comparer
Represents the ienumerable value type.
Definition enumerable_.hpp:87
static auto zip(first_t &&first, second_t &&second, third_t &&third) -> xtd::collections::generic::enumerable_generator< std::tuple< xtd::iterable_value_type< first_t >, xtd::iterable_value_type< second_t >, xtd::iterable_value_type< third_t > > >
Produces a sequence of tuples with elements from the three specified sequences.
static auto min(source_t &&source) -> xtd::iterable_value_type< source_t >
Returns the minimum value in a sequence of xtd::numeric values.
static auto count_by(source_t &&source, key_selector_t &&key_selector, const iequality_comparer< key_t > &key_comparer) noexcept -> xtd::collections::generic::enumerable_generator< xtd::collections::generic::key_value_pair< key_t, xtd::usize > >
Returns the count of elements in the source sequence grouped by key.
static auto as_enumerable(iterator_t first, iterator_t last) noexcept -> xtd::collections::generic::enumerable_generator< typename std::decay< decltype(*first)>::type >
Returns the input typed as xtd::collections::generic::ienumerable <type_t>.
typename xtd::collections::generic::list< type_t > list
Represents the list value type.
Definition enumerable_.hpp:95
static auto as_enumerable(value_t(&array)[length]) noexcept -> xtd::collections::generic::enumerable_generator< value_t >
Returns the input typed as xtd::collections::generic::ienumerable <type_t>.
static auto default_if_empty(source_t &&source) noexcept -> xtd::collections::generic::enumerable_generator< xtd::iterable_value_type< source_t > >
Returns the elements of the specified sequence or the type parameter's default value in a singleton c...
static auto contains(source_t &&source, const xtd::iterable_value_type< source_t > &value) noexcept -> bool
Determines whether a sequence contains a specified element by using the default equality comparer.
static auto aggregate(source_t &&source, accumulate_t &&seed, func_t &&func) -> accumulate_t
Applies an accumulator function over a sequence. The specified seed value is used as the initial accu...
static auto as_enumerable(const value_t(&array)[length]) noexcept -> xtd::collections::generic::enumerable_generator< value_t >
Returns the input typed as xtd::collections::generic::ienumerable <type_t>.
static auto first(source_t &&source, predicate_t &&predicate) -> xtd::iterable_value_type< source_t >
Returns the first element in a sequence that satisfies a specified condition.
static auto aggregate(source_t &&source, accumulate_t &&seed, func_t &&func, result_selector_t &&result_selector) -> result_t
Applies an accumulator function over a sequence. The specified seed value is used as the initial accu...
static auto take(source_t &&source, xtd::usize count) -> xtd::collections::generic::enumerable_generator< xtd::iterable_value_type< source_t > >
Returns a specified number of contiguous elements from the start of a sequence.
static auto average(source_t &&source) -> double
Computes the average of a sequence of xtd::int64 values.
static auto average(source_t &&source) -> xtd::optional< double >
Computes the average of a sequence of optional xtd::int64 values.
static auto as_enumerable(const source_t &source) noexcept -> xtd::collections::generic::enumerable_generator< xtd::iterable_value_type< source_t > >
Returns the input typed as xtd::collections::generic::ienumerable <type_t>.
static auto average(source_t &&source) -> xtd::optional< double >
Computes the average of a sequence of optional double values.
static auto count_by(source_t &&source, key_selector_t &&key_selector) noexcept -> xtd::collections::generic::enumerable_generator< xtd::collections::generic::key_value_pair< key_t, xtd::usize > >
Returns the count of elements in the source sequence grouped by key.
static auto first_or_default(source_t &&source, xtd::iterable_value_type< source_t > &&default_value) noexcept -> xtd::iterable_value_type< source_t >
Returns the first element of the sequence that satisfies a condition or a default value if no such el...
static auto from(iterator_t iterator, xtd::usize length) noexcept -> xtd::collections::generic::enumerable_generator< typename std::decay< decltype(*iterator)>::type >
Returns the input typed as xtd::collections::generic::ienumerable <type_t>.
static auto all(source_t &&source, predicate_t &&predicate) -> bool
Determines whether all elements of a sequence satisfy a condition.
static auto average(source_t &&source) -> xtd::optional< xtd::decimal >
Computes the average of a sequence of optional xtd::decimal values.
static auto as_enumerable(iterator_t iterator, xtd::usize length) noexcept -> xtd::collections::generic::enumerable_generator< typename std::decay< decltype(*iterator)>::type >
Returns the input typed as xtd::collections::generic::ienumerable <type_t>.
static auto distinct(source_t &&source, equater_t &&equater) noexcept -> xtd::collections::generic::enumerable_generator< xtd::iterable_value_type< source_t > >
Returns distinct elements from a sequence by using a specified xtd::collections::generic::iequality_c...
static auto average(source_t &&source) -> xtd::optional< xtd::single >
Computes the average of a sequence of optional float values.
static auto order(source_t &&source, const xtd::collections::generic::icomparer< xtd::iterable_value_type< source_t > > &comparer) -> xtd::collections::generic::enumerable_generator< xtd::iterable_value_type< source_t > >
Sorts the elements of a sequence in ascending order.
static auto from(source_t &&source) noexcept
Returns the input typed as xtd::collections::generic::ienumerable <type_t>.
static auto max(source_t &&source, selector_t &&selector) -> result_t
Returns the maximum value in a sequence of xtd::numeric values.
static auto shuffle(source_t &&source) -> xtd::collections::generic::enumerable_generator< xtd::iterable_value_type< source_t > >
Shuffles the order of the elements of a sequence.
Definition random.hpp:277
static auto contains(source_t &&source, const xtd::iterable_value_type< source_t > &value, equater_t &&equater) noexcept -> bool
Determines whether a sequence contains a specified element by using a specified equality comparer.
static auto order(source_t &&source) -> xtd::collections::generic::enumerable_generator< xtd::iterable_value_type< source_t > >
Sorts the elements of a sequence in ascending order.
static auto cast(source_t &&source) -> xtd::collections::generic::enumerable_generator< result_t >
Casts the elements of an xtd::collections::generic::ienumerable to the specified type.
static auto where(source_t &&source, auto &&predicate) -> xtd::collections::generic::enumerable_generator< xtd::iterable_value_type< source_t > >
Filters a sequence of values based on a predicate.
static auto aggregate(source_t &&source, func_t &&func) -> xtd::iterable_value_type< source_t >
Applies an accumulator function over a sequence.
static auto first_or_default(source_t &&source, prediacte_t &&predicate) noexcept -> xtd::iterable_value_type< source_t >
Returns the first element of the sequence that satisfies a condition or a default value if no such el...
static auto from(iterator_t first, iterator_t last) noexcept -> xtd::collections::generic::enumerable_generator< typename std::decay< decltype(*first)>::type >
Returns the input typed as xtd::collections::generic::ienumerable <type_t>.
static auto as_enumerable(source_t &&source) noexcept
Returns the input typed as xtd::collections::generic::ienumerable <type_t>.
static auto average(source_t &&source) -> xtd::decimal
Computes the average of a sequence of xtd::decimal values.
static auto distinct(source_t &&source, const iequality_comparer< xtd::iterable_value_type< source_t > > &comparer) noexcept -> xtd::collections::generic::enumerable_generator< xtd::iterable_value_type< source_t > >
Returns distinct elements from a sequence by using a specified xtd::collections::generic::iequality_c...
static auto as_enumerable(source_t &source) noexcept -> xtd::collections::generic::enumerable_generator< xtd::iterable_value_type< source_t > >
Returns the input typed as xtd::collections::generic::ienumerable <type_t>.
static auto any(source_t &&source, predicate_t &&predicate) -> bool
Determines whether any element of a sequence satisfies a condition.
static auto from(const value_t(&array)[length]) noexcept -> xtd::collections::generic::enumerable_generator< value_t >
Returns the input typed as xtd::collections::generic::ienumerable <type_t>.
static auto min(source_t &&source, selector_t &&selector) -> xtd::iterable_value_type< source_t >
Returns the minimum value in a sequence of xtd::numeric values.
static auto zip(first_t &&first, second_t &&second, third_t &&third, auto &&result_selector) -> xtd::collections::generic::enumerable_generator< xtd::raw_type< decltype(result_selector(xtd::iterable_value_type< first_t > {}, xtd::iterable_value_type< second_t > {}, xtd::iterable_value_type< third_t > {}))> >
Applies a specified function to the corresponding elements of three sequences, producing a sequence o...
static auto from(value_t(&array)[length]) noexcept -> xtd::collections::generic::enumerable_generator< value_t >
Returns the input typed as xtd::collections::generic::ienumerable <type_t>.
static auto count(source_t &&source, predicate_t &&predicate) noexcept -> xtd::usize
Returns a number that represents how many elements in the specified sequence satisfy a condition.
static auto from(const source_t &source) noexcept -> xtd::collections::generic::enumerable_generator< xtd::iterable_value_type< source_t > >
Returns the input typed as xtd::collections::generic::ienumerable <type_t>.
static auto contains(source_t &&source, const xtd::iterable_value_type< source_t > &value, const iequality_comparer< xtd::iterable_value_type< source_t > > &comparer) noexcept -> bool
Determines whether a sequence contains a specified element by using a specified equality comparer.
static auto average(source_t &&source) -> double
Computes the average of a sequence of double values.
static auto to_array(const ienumerable< source_t > &source)
Creates a xtd::array <type_t> from an xtd::collections::generic::ienumerable <type_t>.
static auto append(source_t &&source, xtd::iterable_value_type< source_t > &&element) noexcept -> xtd::collections::generic::enumerable_generator< xtd::iterable_value_type< source_t > >
Appends a value to the end of the sequence.
static auto repeat(const element_t &element, xtd::usize count) -> xtd::collections::generic::enumerable_generator< element_t >
Generates a sequence that contains one repeated value.
static auto range(integer_t start, integer_t count, integer_t step) -> xtd::collections::generic::enumerable_generator< integer_t >
Generates a sequence of integral numbers within a specified range and step.
static auto first(source_t &&source) -> xtd::iterable_value_type< source_t >
Returns the first element of a sequence.
static auto as_enumerable(std::initializer_list< value_t > source) noexcept -> xtd::collections::generic::enumerable_generator< value_t >
Returns the input typed as xtd::collections::generic::ienumerable <type_t>.
xtd::collections::generic::key_value_pair< key_t, value_t > key_value_pair
Represents the key value pair value type.
Definition enumerable_.hpp:99
static auto order_by(source_t &&source, key_selector_t &&key_selector) -> xtd::collections::generic::enumerable_generator< xtd::iterable_value_type< source_t > >
Sorts the elements of a sequence in ascending order according to a key.
static auto min(source_t &&source, selector_t &&selector) -> result_t
Returns the minimum value in a sequence of xtd::numeric values.
static auto count(source_t &&source) noexcept -> xtd::usize
Returns the number of elements in a sequence.
static auto range(integer_t count) -> xtd::collections::generic::enumerable_generator< integer_t >
Generates a sequence of integral numbers within a specified range.
static auto first_or_default(source_t &&source) noexcept -> xtd::iterable_value_type< source_t >
Returns the first element of the sequence that satisfies a condition or a default value if no such el...
static auto reverse(source_t &&source) -> xtd::collections::generic::enumerable_generator< xtd::iterable_value_type< source_t > >
Inverts the order of the elements in a sequence.
static auto default_if_empty(source_t &&source, const xtd::iterable_value_type< source_t > &default_value) noexcept -> xtd::collections::generic::enumerable_generator< xtd::iterable_value_type< source_t > >
Returns the elements of the specified sequence or the specified value in a singleton collection if th...
static auto skip(source_t &&source, xtd::usize count) -> xtd::collections::generic::enumerable_generator< xtd::iterable_value_type< source_t > >
Bypasses a specified number of elements in a sequence and then returns the remaining elements.
static auto from(source_t &source) noexcept -> xtd::collections::generic::enumerable_generator< xtd::iterable_value_type< source_t > >
Returns the input typed as xtd::collections::generic::ienumerable <type_t>.
static auto count(source_t &&source, xtd::iterable_value_type< source_t > &&value) noexcept -> xtd::usize
Returns the number of elements with the specified value.
static auto select(source_t &&source, auto &&selector) -> xtd::collections::generic::enumerable_generator< xtd::raw_type< decltype(selector(xtd::iterable_value_type< source_t > {}))> >
Projects each element of a sequence into a new form.
static auto max(source_t &&source) -> xtd::iterable_value_type< source_t >
Returns the maximum value in a sequence of xtd::numeric values.
static auto take(source_t &&source, const xtd::range &range) -> xtd::collections::generic::enumerable_generator< xtd::iterable_value_type< source_t > >
Returns a specified number of contiguous elements from the start of a sequence.
static auto take_while(source_t &&source, auto &&predicate) -> xtd::collections::generic::enumerable_generator< xtd::iterable_value_type< source_t > >
Returns elements from a sequence as long as a specified condition is true, and then skips the remaini...
static auto any(source_t &&source) noexcept -> bool
Determines whether a sequence contains any elements.
static auto count_by(source_t &&source, key_selector_t &&key_selector, key_equater_t &&key_equater) noexcept -> xtd::collections::generic::enumerable_generator< xtd::collections::generic::key_value_pair< key_t, xtd::usize > >
Returns the count of elements in the source sequence grouped by key.
static auto sequence_equal(first_t &&first, second_t &&second, equality_comparer_t &&comparer) -> bool
Determines whether two sequences are equal by comparing their elements by using a specifie the equali...
static auto to_list(const ienumerable< source_t > &source)
Creates a xtd::collections::generic::list <type_t> from an xtd::collections::generic::ienumerable <ty...
static auto average(source_t &&source) -> xtd::single
Computes the average of a sequence of float values.
static auto average(source_t &&source) -> xtd::optional< double >
Computes the average of a sequence of optional xtd::int32 values.
static auto average(source_t &&source) -> double
Computes the average of a sequence of xtd::int32 values.
Represents a range that has start and end indexes.
Definition range.hpp:38
Definition numeric.hpp:12
Definition real_decimal.hpp:13
Definition real_double.hpp:13
Definition real_single.hpp:13
Definition signed_integer_32.hpp:13
Definition signed_integer_64.hpp:14
Contains xtd::decimal type.
Contains xtd::collections::generic::equality_comparer <type_t> class.
Contains xtd::func_callable concept.
Contains xtd::collections::generic::comparer <type_t> class.
Contains xtd::collections::generic::enumerator <type_t> class.
xtd::raw_type< decltype(*std::begin(std::declval< iterable_t & >()))> iterable_value_type
Represents the orward iterable value type.
Definition iterable_value_type.hpp:29
xtd::delegate< result_t(arguments_t... arguments)> func
Represents a delegate that has variables parameters and returns a value of the type specified by the ...
Definition func.hpp:27
#define static_
This keyword is use to represent a static object. A static object can't be instantiated (constructors...
Definition static.hpp:38
std::type_info type
Stores information about a type.
Definition type.hpp:23
char8_t char8
Represents a 8-bit unicode character.
Definition char8.hpp:26
wchar_t wchar
Represents a wide character.
Definition wchar.hpp:24
long double decimal
Represents a decimal-precision floating-point number.
Definition decimal.hpp:23
char16_t char16
Represents a 16-bit unicode character.
Definition char16.hpp:26
std::optional< type_t > optional
Represents the optional alias on std::optional.
Definition optional.hpp:26
std::size_t usize
Represents an unsigned size of any object in bytes.
Definition usize.hpp:22
float single
Represents a single-precision floating-point number.
Definition single.hpp:23
char32_t char32
Represents a 32-bit unicode character.
Definition char32.hpp:23
std::remove_cvref_t< value_t > raw_type
Represents a raw type alias equivalent to std::remove_cvref_t<value_t>.
Definition raw_type.hpp:25
xtd::func< bool, type_t > predicate
Represents a delegate that defines a set of criteria and determines whether the specified object meet...
Definition predicate.hpp:16
Contains xtd::iequatable interface.
Contains xtd::int32 type.
Contains xtd::int64 type.
Contains xtd::integer concept.
Contains xtd::iterable concept.
Contains xtd::iterable_value_type alias.
Contains xtd::collections::generic::helpers::lesser struct.
The xtd::collections::generic namespace contains interfaces and classes that define generic collectio...
Definition comparer.hpp:16
Provides classes and interfaces that support queries that use Language-Integrated Query (LINQ).
Definition enumerable_.hpp:59
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8
constexpr auto length() const noexcept -> size_type
Returns the length of the current read_only_span.
Definition read_only_span.hpp:209
constexpr auto size() const noexcept -> size_type
Returns the number of elements.
Definition read_only_span.hpp:213
Contains xtd::numeric concept.
Contains xtd::optional type.
Contains xtd::predicate_callable concept.
Contains xtd::collections::generic::helpers::raw_array class.
Contains xtd::static_object class.
Supports a simple iteration over a generic collection.
Definition enumerator.hpp:39
Defines a key/value pair that can be set or retrieved.
Definition key_value_pair.hpp:37
Contains xtd::usize type.