5#include "../../../linq/enumerable.hpp"
10 namespace collections {
14 namespace extensions {
30 template <
typename enumerable_t,
typename source_t>
42 source_t
aggregate(
const std::function<source_t(
const source_t&,
const source_t&)>&
func)
const {
51 template<
typename func_t>
62 template<
typename accumulate_t>
63 accumulate_t
aggregate(
const accumulate_t& seed,
const std::function<accumulate_t(
const source_t&,
const accumulate_t&)>&
func)
const {
73 template<
typename accumulate_t,
typename func_t>
74 accumulate_t
aggregate(
const accumulate_t& seed,
const func_t&
func)
const {
85 template<
typename accumulate_t,
typename result_t>
86 result_t
aggregate(
const accumulate_t& seed,
const std::function<accumulate_t(
const source_t&,
const accumulate_t&)>&
func,
const std::function<result_t(
const accumulate_t&)>& result_selector)
const {
97 template<
typename accumulate_t,
typename result_t,
typename func_t,
typename result_selector_t>
98 result_t
aggregate(
const accumulate_t& seed,
const func_t&
func,
const result_selector_t& result_selector)
const {
109 template<
typename accumulate_t,
typename func_t,
typename result_selector_t>
110 accumulate_t
aggregate(
const accumulate_t& seed,
const func_t&
func,
const result_selector_t& result_selector)
const {
120 bool all(
const std::function<
bool(
const source_t&)>&
predicate)
const {
129 template<
typename predicate_t>
139 bool any() const noexcept {
148 bool any(
const std::function<
bool(
const source_t&)>&
predicate)
const {
157 template<
typename predicate_t>
205 template<
typename result_t>
207 return xtd::linq::enumerable::select<source_t, result_t>(base(), selector);
213 template<
typename result_t,
typename selector_t>
215 return xtd::linq::enumerable::select<source_t, result_t>(base(), selector);
228 template<
typename selector_t>
246 template<
typename predicate_t>
253 const enumerable_t& base() const noexcept {
return static_cast<const enumerable_t&
>(*this);}
260#include "../../../linq/enumerable_collection.hpp"
261#include "../ienumerable.hpp"
Provides a set of static methods for querying objects that implement ienumerable <type_t>.
Definition enumerable.hpp:31
result_t aggregate(const accumulate_t &seed, const std::function< accumulate_t(const source_t &, const accumulate_t &)> &func, const std::function< result_t(const accumulate_t &)> &result_selector) const
Applies an accumulator function over a sequence. The specified seed value is used as the initial accu...
Definition enumerable.hpp:86
const xtd::collections::generic::ienumerable< source_t > & select(const std::function< source_t(const source_t &)> &selector) const
Projects each element of a sequence into a new form.
Definition enumerable.hpp:221
source_t aggregate(const std::function< source_t(const source_t &, const source_t &)> &func) const
Applies an accumulator function over a sequence.
Definition enumerable.hpp:42
bool any() const noexcept
Determines whether a sequence contains any elements.
Definition enumerable.hpp:139
accumulate_t aggregate(const accumulate_t &seed, const std::function< accumulate_t(const source_t &, const accumulate_t &)> &func) const
Applies an accumulator function over a sequence. The specified seed value is used as the initial accu...
Definition enumerable.hpp:63
const xtd::collections::generic::ienumerable< result_t > & select(const std::function< result_t(const source_t &)> &selector) const
Projects each element of a sequence into a new form.
Definition enumerable.hpp:206
source_t first_or_default(const source_t default_value) const noexcept
Returns the first element of the sequence that satisfies a condition or a default value if no such el...
Definition enumerable.hpp:191
const xtd::collections::generic::ienumerable< source_t > & as_enumerable() const noexcept
Returns the input typed as xtd::collection::generic::ienumerable <type_t>.
Definition enumerable.hpp:177
const xtd::collections::generic::ienumerable< source_t > & where(const std::function< bool(const source_t &)> &predicate) const
Filters a sequence of values based on a predicate.
Definition enumerable.hpp:240
auto average() const noexcept
Computes the average of a sequence of source_t values.
Definition enumerable.hpp:184
const xtd::collections::generic::ienumerable< source_t > & where(const predicate_t &predicate) const
Filters a sequence of values based on a predicate.
Definition enumerable.hpp:247
accumulate_t aggregate(const accumulate_t &seed, const func_t &func) const
Applies an accumulator function over a sequence. The specified seed value is used as the initial accu...
Definition enumerable.hpp:74
bool any(const std::function< bool(const source_t &)> &predicate) const
Determines whether any element of a sequence satisfies a condition.
Definition enumerable.hpp:148
const xtd::collections::generic::list< source_t > & to_list() const noexcept
Creates a xtd::collections::generic::list <type_t> from an xtd::collections::generic::ienumerable <ty...
bool any(const predicate_t &predicate) const
Determines whether any elements of a sequence satisfy a condition.
Definition enumerable.hpp:158
bool all(const std::function< bool(const source_t &)> &predicate) const
Determines whether all elements of a sequence satisfy a condition.
Definition enumerable.hpp:120
const xtd::collections::generic::ienumerable< source_t > & select(const selector_t &selector) const
Projects each element of a sequence into a new form.
Definition enumerable.hpp:229
source_t first_or_default() const noexcept
Returns the first element of the sequence that satisfies a condition or a default value if no such el...
Definition enumerable.hpp:197
accumulate_t aggregate(const accumulate_t &seed, const func_t &func, const result_selector_t &result_selector) const
Applies an accumulator function over a sequence. The specified seed value is used as the initial accu...
Definition enumerable.hpp:110
const xtd::collections::generic::ienumerable< result_t > & select(const selector_t &selector) const
Projects each element of a sequence into a new form.
Definition enumerable.hpp:214
source_t aggregate(const func_t &func) const
Applies an accumulator function over a sequence.
Definition enumerable.hpp:52
const xtd::collections::generic::ienumerable< source_t > & append(const source_t &element) const noexcept
Appends a value to the end of the sequence.
Definition enumerable.hpp:168
bool all(const predicate_t &predicate) const
Determines whether all elements of a sequence satisfy a condition.
Definition enumerable.hpp:130
result_t aggregate(const accumulate_t &seed, const func_t &func, const result_selector_t &result_selector) const
Applies an accumulator function over a sequence. The specified seed value is used as the initial accu...
Definition enumerable.hpp:98
Exposes the enumerator, which supports a simple iteration over a collection of a specified type.
Definition ienumerable.hpp:36
Represents a strongly typed list of objects that can be accessed by index. Provides methods to search...
Definition list.hpp:71
Represents a delegate, which is a data structure that refers to a static method or to a class instanc...
Definition delegate.hpp:370
static const xtd::collections::generic::ienumerable< source_t > & as_enumerable(const xtd::collections::generic::ienumerable< source_t > &source) noexcept
Returns the input typed as xtd::collection::generic::ienumerable <type_t>.
Definition enumerable.hpp:778
static bool all(const xtd::collections::generic::ienumerable< source_t > &source, const std::function< bool(const source_t &)> &predicate)
Determines whether all elements of a sequence satisfy a condition.
Definition enumerable.hpp:466
static xtd::decimal average(const xtd::collections::generic::ienumerable< xtd::decimal > &source)
Computes the average of a sequence of xtd::decimal values.
static source_t aggregate(const xtd::collections::generic::ienumerable< source_t > &source, const std::function< source_t(const source_t &, const source_t &)> &func)
Applies an accumulator function over a sequence.
Definition enumerable.hpp:61
static source_t first_or_default(const xtd::collections::generic::ienumerable< source_t > &source, const source_t &default_value) noexcept
Returns the first element of the sequence that satisfies a condition or a default value if no such el...
Definition enumerable.hpp:879
static bool any(const xtd::collections::generic::ienumerable< source_t > &source) noexcept
Determines whether a sequence contains any elements.
Definition enumerable.hpp:568
static const xtd::collections::generic::ienumerable< source_t > & where(const xtd::collections::generic::ienumerable< source_t > &source, const std::function< bool(const source_t &)> &predicate)
Filters a sequence of values based on a predicate.
Definition enumerable.hpp:1148
static const xtd::collections::generic::ienumerable< source_t > & append(const xtd::collections::generic::ienumerable< source_t > &source, const source_t &element) noexcept
Appends a value to the end of the sequence.
Definition enumerable.hpp:713
static const xtd::collections::generic::ienumerable< result_t > & select(const xtd::collections::generic::ienumerable< source_t > &source, const std::function< result_t(const source_t &)> &selector)
Projects each element of a sequence into a new form.
Definition enumerable.hpp:952
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10