6#include "../predicate.hpp"
7#include "../static.hpp"
41 template<
typename source_t>
44 auto aggregated = source_t {};
45 for (
const auto& item : source)
46 if (nb++ == 0) aggregated = item;
47 else aggregated =
func(aggregated, item);
57 template<
typename source_t,
typename func_t>
69 template<
typename source_t,
typename accumulate_t>
71 auto aggregated = seed;
72 for (
const auto& item : source)
73 aggregated =
func(aggregated, item);
84 template<
typename source_t,
typename accumulate_t,
typename func_t>
97 template<
typename source_t,
typename accumulate_t,
typename result_t>
99 auto aggregated = seed;
100 for (
const auto& item : source)
101 aggregated =
func(aggregated, item);
102 return result_selector(aggregated);
113 template<
typename source_t,
typename accumulate_t,
typename result_t,
typename func_t,
typename result_selector_t>
126 template<
typename source_t,
typename accumulate_t,
typename func_t,
typename result_selector_t>
138 template<
typename accumulate_t,
typename input_iterator_t>
141 auto aggregated = accumulate_t {};
142 for (
auto iterator = first; iterator != last; ++iterator)
143 if (nb++ == 0) aggregated = *iterator;
144 else aggregated =
func(aggregated, *iterator);
155 template<
typename accumulate_t,
typename input_iterator_t,
typename func_t>
156 static accumulate_t
aggregate(input_iterator_t first, input_iterator_t last,
const func_t&
func) {
167 template<
typename accumulate_t,
typename input_iterator_t>
169 auto aggregated = seed;
170 for (
auto iterator = first; iterator != last; ++iterator)
171 aggregated =
func(aggregated, *iterator);
183 template<
typename accumulate_t,
typename input_iterator_t,
typename func_t>
184 static accumulate_t
aggregate(input_iterator_t first, input_iterator_t last,
const accumulate_t& seed,
const func_t&
func) {
197 template<
typename accumulate_t,
typename result_t,
typename input_iterator_t>
199 auto aggregated = seed;
200 for (
auto iterator = first; iterator != last; ++iterator)
201 aggregated =
func(aggregated, *iterator);
202 return result_selector(aggregated);
214 template<
typename accumulate_t,
typename result_t,
typename input_iterator_t,
typename func_t,
typename result_selector_t>
215 static result_t
aggregate(input_iterator_t first, input_iterator_t last,
const accumulate_t& seed,
const func_t&
func,
const result_selector_t& result_selector) {
228 template<
typename accumulate_t,
typename input_iterator_t,
typename func_t,
typename result_selector_t>
229 static accumulate_t
aggregate(input_iterator_t first, input_iterator_t last,
const accumulate_t& seed,
const func_t&
func,
const result_selector_t& result_selector) {
240 template<
typename source_t>
242 for (
const auto& item : source)
253 template<
typename source_t,
typename predicate_t>
265 template<
typename source_t,
typename input_iterator_t>
267 for (
auto iterator = first; iterator != last; ++iterator)
279 template<
typename source_t,
typename input_iterator_t,
typename predicate_t>
280 static bool all(input_iterator_t first, input_iterator_t last,
const predicate_t&
predicate) {
291 template<
typename source_t>
302 template<
typename source_t>
304 for (
const auto& item : source)
315 template<
typename source_t,
typename predicate_t>
326 template<
typename source_t,
typename input_iterator_t>
327 static bool any(input_iterator_t first, input_iterator_t last) {
328 return first != last;
338 template<
typename source_t,
typename input_iterator_t>
340 for (
auto iterator = first; iterator != last; ++iterator)
351 template<
typename source_t,
typename input_iterator_t,
typename predicate_t>
352 static bool any(input_iterator_t first, input_iterator_t last,
const predicate_t&
predicate) {
Exposes the enumerator, which supports a simple iteration over a collection of a specified type.
Definition ienumerable.hpp:35
virtual enumerator< type_t > get_enumerator() const =0
Returns an enumerator that iterates through a collection.
Represents a delegate, which is a data structure that refers to a static method or to a class instanc...
Definition delegate.hpp:370
Provides a set of static methods for querying objects that implement ienumerable <type_t>.
Definition enumerable.hpp:29
static bool all(input_iterator_t first, input_iterator_t last, const xtd::predicate< const source_t & > &predicate)
Determines whether all elements of a sequence satisfy a condition.
Definition enumerable.hpp:266
static accumulate_t aggregate(const xtd::collections::generic::ienumerable< source_t > &source, const accumulate_t &seed, const func_t &func)
Applies an accumulator function over a sequence. The specified seed value is used as the initial accu...
Definition enumerable.hpp:85
static accumulate_t aggregate(input_iterator_t first, input_iterator_t last, const func_t &func)
Applies an accumulator function over a sequence.
Definition enumerable.hpp:156
static result_t aggregate(input_iterator_t first, input_iterator_t last, const accumulate_t &seed, const func_t &func, const result_selector_t &result_selector)
Applies an accumulator function over a sequence. The specified seed value is used as the initial accu...
Definition enumerable.hpp:215
static accumulate_t aggregate(input_iterator_t first, input_iterator_t last, const accumulate_t &seed, const func_t &func, const result_selector_t &result_selector)
Applies an accumulator function over a sequence. The specified seed value is used as the initial accu...
Definition enumerable.hpp:229
static source_t aggregate(const xtd::collections::generic::ienumerable< source_t > &source, const func_t &func)
Applies an accumulator function over a sequence.
Definition enumerable.hpp:58
static accumulate_t aggregate(input_iterator_t first, input_iterator_t last, const xtd::func< accumulate_t, const accumulate_t &, const accumulate_t & > &func)
Applies an accumulator function over a sequence.
Definition enumerable.hpp:139
static bool any(input_iterator_t first, input_iterator_t last, const xtd::predicate< const source_t & > &predicate)
Determines whether any elements of a sequence satisfy a condition.
Definition enumerable.hpp:339
static bool all(const xtd::collections::generic::ienumerable< source_t > &source, const xtd::predicate< const source_t & > &predicate)
Determines whether all elements of a sequence satisfy a condition.
Definition enumerable.hpp:241
static accumulate_t aggregate(input_iterator_t first, input_iterator_t last, const accumulate_t &seed, const func_t &func)
Applies an accumulator function over a sequence. The specified seed value is used as the initial accu...
Definition enumerable.hpp:184
static accumulate_t aggregate(input_iterator_t first, input_iterator_t last, const accumulate_t &seed, const xtd::func< accumulate_t, const accumulate_t &, const accumulate_t & > &func)
Applies an accumulator function over a sequence. The specified seed value is used as the initial accu...
Definition enumerable.hpp:168
static accumulate_t aggregate(const xtd::collections::generic::ienumerable< source_t > &source, const accumulate_t &seed, const xtd::func< accumulate_t, const source_t &, const accumulate_t & > &func)
Applies an accumulator function over a sequence. The specified seed value is used as the initial accu...
Definition enumerable.hpp:70
static result_t aggregate(const xtd::collections::generic::ienumerable< source_t > &source, const accumulate_t &seed, const xtd::func< accumulate_t, const source_t &, const accumulate_t & > &func, const xtd::func< result_t, const accumulate_t & > &result_selector)
Applies an accumulator function over a sequence. The specified seed value is used as the initial accu...
Definition enumerable.hpp:98
static source_t aggregate(const xtd::collections::generic::ienumerable< source_t > &source, const xtd::func< source_t, const source_t &, const source_t & > &func)
Applies an accumulator function over a sequence.
Definition enumerable.hpp:42
static result_t aggregate(const xtd::collections::generic::ienumerable< source_t > &source, const accumulate_t &seed, const func_t &func, const result_selector_t &result_selector)
Applies an accumulator function over a sequence. The specified seed value is used as the initial accu...
Definition enumerable.hpp:114
static accumulate_t aggregate(const xtd::collections::generic::ienumerable< source_t > &source, const accumulate_t &seed, const func_t &func, const result_selector_t &result_selector)
Applies an accumulator function over a sequence. The specified seed value is used as the initial accu...
Definition enumerable.hpp:127
static bool any(const xtd::collections::generic::ienumerable< source_t > &source)
Determines whether a sequence contains any elements.
Definition enumerable.hpp:292
static result_t aggregate(input_iterator_t first, input_iterator_t last, const accumulate_t &seed, const xtd::func< accumulate_t, const accumulate_t &, const accumulate_t & > &func, const xtd::func< result_t, const accumulate_t & > &result_selector)
Applies an accumulator function over a sequence. The specified seed value is used as the initial accu...
Definition enumerable.hpp:198
static bool any(const xtd::collections::generic::ienumerable< source_t > &source, const predicate_t &predicate)
Determines whether any elements of a sequence satisfy a condition.
Definition enumerable.hpp:316
static bool any(input_iterator_t first, input_iterator_t last, const predicate_t &predicate)
Determines whether any elements of a sequence satisfy a condition.
Definition enumerable.hpp:352
static bool all(const xtd::collections::generic::ienumerable< source_t > &source, const predicate_t &predicate)
Determines whether all elements of a sequence satisfy a condition.
Definition enumerable.hpp:254
static bool all(input_iterator_t first, input_iterator_t last, const predicate_t &predicate)
Determines whether all elements of a sequence satisfy a condition.
Definition enumerable.hpp:280
static bool any(const xtd::collections::generic::ienumerable< source_t > &source, const xtd::predicate< const source_t & > &predicate)
Determines whether any element of a sequence satisfies a condition.
Definition enumerable.hpp:303
static bool any(input_iterator_t first, input_iterator_t last)
Determines whether a sequence contains any elements.
Definition enumerable.hpp:327
Contains xtd::linq::enumerable_collection <type_t> alias.
#define static_
This keyword is use to represent a static object. A static object can't be instantiated (constructors...
Definition static.hpp:37
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
delegate< result_t(arguments_t...)> func
Represents a delegate that has variables parameters and returns a value of the type specified by the ...
Definition func.hpp:16
@ any
Indicates that all styles except allow_binary_specifier, allow_octal_specifier and allow_hex_specifie...
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10