Provides a set of static methods for querying objects that implement ienumerable <type_t>.
Public Aliases | |
| using | enumerable_type |
| Represents the ienumerable enumerable type. | |
| using | value_type |
| Represents the ienumerable value type. | |
| template<typename type_t> | |
| using | ienumerable |
| Represents the ienumerable value type. | |
| template<typename type_t> | |
| using | list |
| Represents the list value type. | |
Public Static Methods | |
| auto | aggregate (auto &&funcfunc) const -> value_t |
| Applies an accumulator function over a sequence. | |
| auto | aggregate (value_t &&seed, auto &&funcfunc) const -> value_t |
| Applies an accumulator function over a sequence. The specified seed value is used as the initial accumulator value. | |
| auto | aggregate (value_t &&seed, auto &&funcfunc, auto &&result_selector) const |
| Applies an accumulator function over a sequence. The specified seed value is used as the initial accumulator value, and the specified function is used to select the result value. | |
| template<xtd::predicate_callable< value_t > predicate_t> | |
| auto | all (predicate_t &&predicatepredicate) const -> bool |
| Determines whether all elements of a sequence satisfy a condition. | |
| auto | any () const noexcept -> bool |
| Determines whether a sequence contains any elements. | |
| template<xtd::predicate_callable< value_t > predicate_t> | |
| auto | any (predicate_t &&predicatepredicate) const -> bool |
| Determines whether any element of a sequence satisfies a condition. | |
| template<typename element_t> | |
| auto | append (element_t &&element) const noexcept -> xtd::collections::generic::enumerable_generator< value_t > |
| Appends a value to the end of the sequence. | |
| auto | as_enumerable () const noexcept |
| Returns the input typed as xtd::collections::generic::ienumerable <type_t>. | |
| auto | average () const noexcept |
| Computes the average of a sequence of value_t values. | |
| template<typename result_t> | |
| auto | cast () const noexcept -> xtd::collections::generic::enumerable_generator< result_t > |
| Casts the elements of an xtd::collections::generic::ienumerable to the specified type. | |
| auto | chunk (xtd::usize size) const -> xtd::collections::generic::enumerable_generator< xtd::array< value_t > > |
| Splits the elements of a sequence into chunks of size at most size. | |
| template<xtd::iterable second_t> | |
| auto | concat (second_t &&second) const noexcept -> xtd::collections::generic::enumerable_generator< value_t > |
| Concatenates two sequences. | |
| auto | contains (value_t &&value) const noexcept -> bool |
| Determines whether a sequence contains a specified element by using the default equality comparer. | |
| auto | contains (value_t &&value, xtd::collections::generic::iequality_comparer< value_t > &&comparer) const noexcept -> bool |
| Determines whether a sequence contains a specified element by using a specified equality comparer. | |
| template<xtd::func_callable< bool, value_t, value_t > equater_t> | |
| auto | contains (value_t &&value, equater_t &&equater) const noexcept -> bool |
| Determines whether a sequence contains a specified element by using a specified equality comparer. | |
| auto | count () const noexcept -> xtd::usize |
| Returns the number of elements in current sequence. | |
| template<xtd::predicate_callable< value_t > predicate_t> | |
| auto | count (predicate_t &&predicatepredicate) const noexcept -> xtd::usize |
| Returns a number that represents how many elements in the specified sequence satisfy a condition. | |
| auto | count (value_t &&value) const noexcept -> xtd::usize |
| Returns the number of elements with the specified value. | |
| template<typename key_t, xtd::callable< key_t, value_t > key_selector_t> | |
| auto | count_by (key_selector_t &&key_selector) const noexcept |
| Returns the count of elements in the current sequence grouped by key. | |
| template<typename key_t, xtd::callable< key_t, value_t > key_selector_t> | |
| auto | count_by (key_selector_t &&key_selector, xtd::collections::generic::iequality_comparer< key_t > &&key_comparer) const noexcept -> xtd::collections::generic::enumerable_generator< xtd::collections::generic::key_value_pair< key_t, xtd::usize > > |
| Returns the count of elements in the current sequence grouped by key. | |
| template<typename key_t, xtd::callable< key_t, value_t > key_selector_t, xtd::func_callable< bool, key_t, key_t > key_equater_t> | |
| auto | count_by (key_selector_t &&key_selector, key_equater_t &&key_equater) const noexcept -> xtd::collections::generic::enumerable_generator< xtd::collections::generic::key_value_pair< key_t, xtd::usize > > |
| Returns the count of elements in the current sequence grouped by key. | |
| auto | default_if_empty () const noexcept -> xtd::collections::generic::enumerable_generator< value_t > |
| Returns the elements of the specified sequence or the type parameter's default value in a singleton collection if the current sequence is empty. | |
| auto | default_if_empty (const value_t &default_value) const noexcept -> xtd::collections::generic::enumerable_generator< value_t > |
| Returns the elements of the specified sequence or the specified value in a singleton collection if the current sequence is empty. | |
| auto | distinct () const noexcept -> xtd::collections::generic::enumerable_generator< value_t > |
| Returns distinct elements from a sequence by using the default equality comparer to compare values. | |
| auto | distinct (xtd::collections::generic::iequality_comparer< value_t > &&comparer) const noexcept -> xtd::collections::generic::enumerable_generator< value_t > |
| Returns distinct elements from a sequence by using a specified xtd::collections::generic::iequality_comparer <type_t> to compare values. | |
| template<xtd::func_callable< bool, value_t, value_t > equater_t> | |
| auto | distinct (equater_t &&equater) const noexcept -> xtd::collections::generic::enumerable_generator< value_t > |
| Returns distinct elements from a sequence by using a specified xtd::collections::generic::iequality_comparer <type_t> to compare values. | |
| auto | first () const -> value_t |
| Returns the first element of a sequence. | |
| template<xtd::func_callable< bool, value_t > prediacte_t> | |
| auto | first (prediacte_t &&prediacte) const -> value_t |
| Returns the first element in a sequence that satisfies a specified condition. | |
| template<xtd::predicate_callable< value_t > predicate_t> | |
| auto | first_or_default (predicate_t &&predicatepredicate, value_t &&default_value) const noexcept -> value_t |
| Returns the first element of the sequence that satisfies a condition, or a specified default value if no such element is found. | |
| template<xtd::predicate_callable< value_t > predicate_t> | |
| auto | first_or_default (predicate_t &&predicatepredicate) const noexcept -> value_t |
| Returns the first element of the sequence that satisfies a condition or a default value if no such element is found. | |
| auto | first_or_default (value_t &&default_value) const noexcept -> value_t |
| Returns the first element of the sequence that satisfies a condition or a default value if no such element is found. | |
| auto | first_or_default () const noexcept -> value_t |
| Returns the first element of the sequence that satisfies a condition or a default value if no such element is found. | |
| auto | last () const -> value_t |
| Returns the last element of a sequence. | |
| template<xtd::func_callable< bool, value_t > prediacte_t> | |
| auto | last (prediacte_t &&prediacte) const -> value_t |
| Returns the last element in a sequence that satisfies a specified condition. | |
| auto | max () const -> value_t |
| Returns the maximum value in a sequence of xtd::numeric values. | |
| template<xtd::callable< value_t, value_t > selector_t> requires xtd::numeric<value_t> | |
| auto | max (selector_t &&selector) const -> value_t |
| Returns the maximum value in a sequence of xtd::numeric values. | |
| template<typename result_t, xtd::callable< result_t, value_t > selector_t> requires xtd::numeric<result_t> | |
| auto | max (selector_t &&selector) const -> result_t |
| Returns the maximum value in a sequence of xtd::numeric values. | |
| auto | min () const -> value_t |
| Returns the minimum value in a sequence of xtd::numeric values. | |
| template<xtd::callable< value_t, value_t > selector_t> requires xtd::numeric<value_t> | |
| auto | min (selector_t &&selector) const -> value_t |
| Returns the minimum value in a sequence of xtd::numeric values. | |
| template<typename result_t, xtd::callable< result_t, value_t > selector_t> requires xtd::numeric<result_t> | |
| auto | min (selector_t &&selector) const -> result_t |
| Returns the minimum value in a sequence of xtd::numeric values. | |
| auto | order () const -> xtd::collections::generic::enumerable_generator< value_t > |
| Sorts the elements of a sequence in ascending order. | |
| auto | order (const xtd::collections::generic::icomparer< value_t > &comparer) const -> xtd::collections::generic::enumerable_generator< value_t > |
| Sorts the elements of a sequence in ascending order. | |
| template<xtd::func_callable< bool, value_t, value_t > lesser_t> | |
| auto | order (lesser_t &&lesser) const -> xtd::collections::generic::enumerable_generator< value_t > |
| Sorts the elements of a sequence in ascending order. | |
| auto | order_by (const std::function< value_t(const value_t &)> &key_selector) const |
| Sorts the elements of a sequence in ascending order according to a key. | |
| template<typename key_t> | |
| auto | order_by_descending (const std::function< key_t(const value_t &)> &key_selector) const |
| Sorts the elements of a sequence in descending order according to a key. | |
| auto | order_by_descending (const std::function< value_t(const value_t &)> &key_selector) const |
| Sorts the elements of a sequence in descending order according to a key. | |
| template<typename key_t> | |
| auto | order_by (const std::function< key_t(const value_t &)> &key_selector) const |
| Sorts the elements of a sequence in ascending order according to a key. | |
| auto | reverse () const -> xtd::collections::generic::enumerable_generator< value_t > |
| Inverts the order of the elements in a sequence. | |
| auto | select (auto &&selector) const |
| Projects each element of a sequence into a new form. | |
| template<xtd::iterable second_t> | |
| auto | sequence_equal (second_t &&second) const -> bool |
| Determines whether two sequences are equal by comparing the elements by using the default equality comparer for their type. | |
| template<xtd::iterable second_t> | |
| auto | sequence_equal (second_t &&second, const xtd::collections::generic::iequality_comparer< value_t > &equality_comparer) const -> bool |
| Determines whether two sequences are equal by comparing their elements by using a specifie the equality comparer. | |
| template<xtd::iterable second_t, xtd::func_callable< bool, value_t, xtd::iterable_value_type< second_t > > equality_comparer_t> | |
| auto | sequence_equal (second_t &&second, equality_comparer_t &&equality_comparer) const -> bool |
| Determines whether two sequences are equal by comparing their elements by using a specifie the equality comparer. | |
| auto | shuffle () const -> xtd::collections::generic::enumerable_generator< value_t > |
| Shuffles the order of the elements of a sequence. | |
| auto | skip (xtd::usize count) const -> xtd::collections::generic::enumerable_generator< value_t > |
| Bypasses a specified number of elements in a sequence and then returns the remaining elements. | |
| auto | skip_while (auto &&predicatepredicate) const -> xtd::collections::generic::enumerable_generator< value_t > |
| Bypasses elements in a sequence as long as a specified condition is true and then returns the remaining elements. | |
| auto | take (xtd::usize count) const -> xtd::collections::generic::enumerable_generator< value_t > |
| Returns a specified number of contiguous elements from the start of a sequence. | |
| auto | take (const xtd::range &range) const -> xtd::collections::generic::enumerable_generator< value_t > |
| Returns a specified number of contiguous elements from the start of a sequence. | |
| auto | take_while (auto &&predicatepredicate) const -> xtd::collections::generic::enumerable_generator< value_t > |
| Returns elements from a sequence as long as a specified condition is true, and then skips the remaining elements. | |
| auto | to_array () const -> xtd::array< value_t > |
| Creates a xtd::array <type_t> from an xtd::collections::generic::ienumerable <type_t>. | |
| auto | to_list () const -> xtd::collections::generic::list< value_t > |
| Creates a xtd::collections::generic::list <type_t> from an xtd::collections::generic::ienumerable <type_t>. | |
| auto | where (auto &&predicatepredicate) const |
| Filters a sequence of values based on a predicate. | |
| template<xtd::iterable second_t> | |
| auto | zip (second_t &&second) const -> xtd::collections::generic::enumerable_generator< std::tuple< value_t, xtd::iterable_value_type< second_t > > > |
| Produces a sequence of tuples with elements from the two specified sequences. | |
| template<xtd::iterable second_t> | |
| auto | zip (second_t &&second, auto &&result_selector) const |
| Applies a specified function to the corresponding elements of two sequences, producing a sequence of the results. | |
| template<xtd::iterable second_t, xtd::iterable third_t> | |
| auto | zip (second_t &&second, third_t &&third) const -> xtd::collections::generic::enumerable_generator< std::tuple< value_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. | |
| template<xtd::iterable second_t, xtd::iterable third_t> | |
| auto | zip (second_t &&second, third_t &&third, auto &&result_selector) const |
| Applies a specified function to the corresponding elements of three sequences, producing a sequence of the results. | |
| using xtd::collections::generic::extensions::enumerable< value_t, enumerable_t >::enumerable_type |
Represents the ienumerable enumerable type.
| using xtd::collections::generic::extensions::enumerable< value_t, enumerable_t >::value_type |
Represents the ienumerable value type.
| using xtd::collections::generic::extensions::enumerable< value_t, enumerable_t >::ienumerable |
Represents the ienumerable value type.
| using xtd::collections::generic::extensions::enumerable< value_t, enumerable_t >::list |
Represents the list value type.
|
inlinenodiscard |
Applies an accumulator function over a sequence.
| func | An accumulator function to be invoked on each element. |
|
inlinenodiscard |
Applies an accumulator function over a sequence. The specified seed value is used as the initial accumulator value.
| accumulate_t | The type of the accumulator value. |
| seed | The initial accumulator value. |
| func | An accumulator function to be invoked on each element. |
|
inlinenodiscard |
Applies an accumulator function over a sequence. The specified seed value is used as the initial accumulator value, and the specified function is used to select the result value.
| result_t | The type of the resulting value. |
| accumulate_t | The type of the accumulator value. |
| seed | The initial accumulator value. |
| func | An accumulator function to be invoked on each element. |
| result_Selector | A function to transform the final accumulator value into the result value. |
|
inlinenodiscard |
Determines whether all elements of a sequence satisfy a condition.
| predicate | A function to test each element for a condition. |
|
inlinenodiscardnoexcept |
Determines whether a sequence contains any elements.
|
inlinenodiscard |
Determines whether any element of a sequence satisfies a condition.
| predicate | A function to test each element for a condition. |
|
inlinenodiscardnoexcept |
Appends a value to the end of the sequence.
| element | The value to append to source. |
|
inlinenodiscardnoexcept |
Returns the input typed as xtd::collections::generic::ienumerable <type_t>.
|
inlinenodiscardnoexcept |
Computes the average of a sequence of value_t values.
| xtd::invalid_operation_exception | this sequence contains no elements. |
|
inlinenodiscardnoexcept |
Casts the elements of an xtd::collections::generic::ienumerable to the specified type.
| result_t | The type of the resulting value. |
| xtd::invalid_cast_exception | An element in the sequence cannot be cast to type result_t. |
|
inlinenodiscard |
Splits the elements of a sequence into chunks of size at most size.
| size | The maximum size of each chunk. |
|
inlinenodiscardnoexcept |
Concatenates two sequences.
| second | The sequence to concatenate to the current sequence. |
|
inlinenodiscardnoexcept |
Determines whether a sequence contains a specified element by using the default equality comparer.
| value | The value to locate in the sequence. |
|
inlinenodiscardnoexcept |
Determines whether a sequence contains a specified element by using a specified equality comparer.
| value | The value to locate in the sequence. |
| comparer | An equality comparer to compare values. |
|
inlinenodiscardnoexcept |
Determines whether a sequence contains a specified element by using a specified equality comparer.
| value | The value to locate in the sequence. |
| comparer | An equality comparer to compare values. |
|
inlinenodiscardnoexcept |
Returns the number of elements in current sequence.
|
inlinenodiscardnoexcept |
Returns a number that represents how many elements in the specified sequence satisfy a condition.
| predicate | A function to test each element for a condition. |
|
inlinenodiscardnoexcept |
Returns the number of elements with the specified value.
| value | The value to search for. |
|
inlinenodiscardnoexcept |
Returns the count of elements in the current sequence grouped by key.
| key_t | The type of the key returned by key_selector. |
| key_selector | A function to extract the key for each element. |
|
inlinenodiscardnoexcept |
Returns the count of elements in the current sequence grouped by key.
| key_t | The type of the key returned by key_selector. |
| key_selector | A function to extract the key for each element. |
| key_comparer | An equality comparer to compare keys. |
|
inlinenodiscardnoexcept |
Returns the count of elements in the current sequence grouped by key.
| key_t | The type of the key returned by key_selector. |
| key_selector | A function to extract the key for each element. |
| key_comparer | An equality comparer to compare keys. |
|
inlinenodiscardnoexcept |
Returns the elements of the specified sequence or the type parameter's default value in a singleton collection if the current sequence is empty.
|
inlinenodiscardnoexcept |
Returns the elements of the specified sequence or the specified value in a singleton collection if the current sequence is empty.
| default_value | The value to return if the sequence is empty. |
|
inlinenodiscardnoexcept |
Returns distinct elements from a sequence by using the default equality comparer to compare values.
|
inlinenodiscardnoexcept |
Returns distinct elements from a sequence by using a specified xtd::collections::generic::iequality_comparer <type_t> to compare values.
| comparer | An xtd::collections::generic::iequality_comparer <type_t> to compare values. |
|
inlinenodiscardnoexcept |
Returns distinct elements from a sequence by using a specified xtd::collections::generic::iequality_comparer <type_t> to compare values.
| equater | An equality comparer to compare values. |
|
inlinenodiscard |
Returns the first element of a sequence.
| xtd::invalid_operation_exception | The source sequence is empty. |
|
inlinenodiscard |
Returns the first element in a sequence that satisfies a specified condition.
| predicate | A function to test each element for a condition. |
| xtd::invalid_operation_exception | The source sequence is empty. |
|
inlinenodiscardnoexcept |
Returns the first element of the sequence that satisfies a condition, or a specified default value if no such element is found.
| predicate | A function to test each element for a condition. |
| default_value | The default value to return if the sequence is empty. |
|
inlinenodiscardnoexcept |
Returns the first element of the sequence that satisfies a condition or a default value if no such element is found.
| predicate | A function to test each element for a condition. |
|
inlinenodiscardnoexcept |
Returns the first element of the sequence that satisfies a condition or a default value if no such element is found.
| default_value | The default value to return if the sequence is empty. |
|
inlinenodiscardnoexcept |
Returns the first element of the sequence that satisfies a condition or a default value if no such element is found.
|
inlinenodiscard |
Returns the last element of a sequence.
| xtd::invalid_operation_exception | The source sequence is empty. |
|
inlinenodiscard |
Returns the last element in a sequence that satisfies a specified condition.
| predicate | A function to test each element for a condition. |
| xtd::invalid_operation_exception | The source sequence is empty. |
|
inlinenodiscard |
Returns the maximum value in a sequence of xtd::numeric values.
|
inlinenodiscard |
Returns the maximum value in a sequence of xtd::numeric values.
| selector | A transform function to apply to each element. |
|
inlinenodiscard |
Returns the maximum value in a sequence of xtd::numeric values.
| selector | A transform function to apply to each element. |
|
inlinenodiscard |
Returns the minimum value in a sequence of xtd::numeric values.
|
inlinenodiscard |
Returns the minimum value in a sequence of xtd::numeric values.
| selector | A transform function to apply to each element. |
|
inlinenodiscard |
Returns the minimum value in a sequence of xtd::numeric values.
| selector | A transform function to apply to each element. |
|
inlinenodiscard |
Sorts the elements of a sequence in ascending order.
|
inlinenodiscard |
Sorts the elements of a sequence in ascending order.
| comparer | An xtd::collections::generic::icomparer <value_t> to compare keys. |
|
inlinenodiscard |
Sorts the elements of a sequence in ascending order.
| lesser | An xtd::collections::generic::icomparer <value_t> to compare keys. |
|
inlinenodiscard |
Sorts the elements of a sequence in ascending order according to a key.
| key_selector | A function to extract a key from an element. |
|
inlinenodiscard |
Sorts the elements of a sequence in descending order according to a key.
| key_selector | A function to extract a key from an element. |
|
inlinenodiscard |
Sorts the elements of a sequence in descending order according to a key.
| key_selector | A function to extract a key from an element. |
|
inlinenodiscard |
Sorts the elements of a sequence in ascending order according to a key.
| key_selector | A function to extract a key from an element. |
|
inlinenodiscard |
Inverts the order of the elements in a sequence.
|
inlinenodiscard |
Projects each element of a sequence into a new form.
| selector | A transform function to apply to each element. |
|
inlinenodiscard |
Determines whether two sequences are equal by comparing the elements by using the default equality comparer for their type.
| first | A sequence of values to compare to second. |
| second | A sequence of values to compare to first. |
|
inlinenodiscard |
Determines whether two sequences are equal by comparing their elements by using a specifie the equality comparer.
| second | A sequence of values to compare to first. |
| equality_comparer | An xtd::collections::generic::iequality_comparer <value_t> to use to compare elements. |
|
inlinenodiscard |
Determines whether two sequences are equal by comparing their elements by using a specifie the equality comparer.
| second | A sequence of values to compare to first. |
| equality_comparer | An xtd::iterable_value_type<first_t>, xtd::iterable_value_type<second_t>> to use to compare elements. |
|
inlinenodiscard |
Shuffles the order of the elements of a sequence.
|
inlinenodiscard |
Bypasses a specified number of elements in a sequence and then returns the remaining elements.
| count | The number of elements to skip before returning the remaining elements. |
|
inlinenodiscard |
Bypasses elements in a sequence as long as a specified condition is true and then returns the remaining elements.
| predicate | A function to test each element for a condition. |
|
inlinenodiscard |
Returns a specified number of contiguous elements from the start of a sequence.
| source | A sequence of values to return elements from. |
| count | The number of elements to return. |
|
inlinenodiscard |
Returns a specified number of contiguous elements from the start of a sequence.
| source | A sequence of values to return elements from. |
| range | The range of elements to return. |
|
inlinenodiscard |
Returns elements from a sequence as long as a specified condition is true, and then skips the remaining elements.
| predicate | A function to test each element for a condition. |
|
nodiscard |
Creates a xtd::array <type_t> from an xtd::collections::generic::ienumerable <type_t>.
|
nodiscard |
Creates a xtd::collections::generic::list <type_t> from an xtd::collections::generic::ienumerable <type_t>.
|
inlinenodiscard |
Filters a sequence of values based on a predicate.
| predicate | A function to test each element for a condition. |
|
inlinenodiscard |
Produces a sequence of tuples with elements from the two specified sequences.
| second | The second sequence to merge. |
|
inlinenodiscard |
Applies a specified function to the corresponding elements of two sequences, producing a sequence of the results.
| second | The second sequence to merge. |
| result_selector | A function that specifies how to merge the elements from the two sequences. |
|
inlinenodiscard |
Produces a sequence of tuples with elements from the three specified sequences.
| second | The second sequence to merge. |
| third | The third sequence to merge. |
|
inlinenodiscard |
Applies a specified function to the corresponding elements of three sequences, producing a sequence of the results.
| second | The second sequence to merge. |
| third | The third sequence to merge. |
| result_selector | A function that specifies how to merge the elements from the three sequences. |