12#define __XTD_STD_INTERNAL__
14#undef __XTD_STD_INTERNAL__
15#define __XTD_CORE_INTERNAL__
19#undef __XTD_CORE_INTERNAL__
35template<
typename type_t>
36struct __opaque_xtd_linq_enumerable_collection__;
37template<
typename type_t,
typename param_t>
38struct __opaque_xtd_linq_lazy_enumerable__;
45 template<
typename type_t>
74 template<
typename type_t>
78 template<
typename type_t>
82 template<
typename type_t>
86 template<
typename type_t>
90 template<
typename key_t,
typename value_t>
105 template<
typename source_t>
108 auto aggregated = source_t {};
109 for (
const auto& item : source)
110 if (nb++ == 0) aggregated = item;
111 else aggregated =
func(aggregated, item);
123 template<
typename source_t>
125 auto aggregated = seed;
126 for (
const auto& item : source)
127 aggregated =
func(aggregated, item);
140 template<
typename accumulate_t,
typename source_t>
141 [[nodiscard]]
static auto aggregate(
const ienumerable<source_t>& source,
const accumulate_t& seed,
const std::function<accumulate_t(
const accumulate_t&,
const source_t&)>&
func) -> accumulate_t {
142 auto aggregated = seed;
143 for (
const auto& item : source)
144 aggregated =
func(aggregated, item);
157 template<
typename source_t>
158 [[nodiscard]]
static auto aggregate(
const ienumerable<source_t>& source,
const source_t& seed,
const std::function<source_t(
const source_t&,
const source_t&)>&
func,
const std::function<source_t(
const source_t&)>& result_selector) -> source_t {
159 auto aggregated = seed;
160 for (
const auto& item : source)
161 aggregated =
func(aggregated, item);
162 return result_selector(aggregated);
176 template<
typename result_t,
typename accumulate_t,
typename source_t>
177 [[nodiscard]]
static auto aggregate(
const ienumerable<source_t>& source,
const accumulate_t& seed,
const std::function<accumulate_t(
const accumulate_t&,
const source_t&)>&
func,
const std::function<result_t(
const accumulate_t&)>& result_selector) -> result_t {
178 auto aggregated = seed;
179 for (
const auto& item : source)
180 aggregated =
func(aggregated, item);
181 return result_selector(aggregated);
192 template<
typename source_t>
194 for (
const auto& item : source)
207 template<
typename source_t>
209 return source.begin() != source.end();
219 template<
typename source_t>
221 for (
const auto& item : source)
234 template<
typename source_t>
236 auto result = __opaque_xtd_linq_enumerable_collection__<source_t> {};
237 for (
const auto& item : source)
238 result.items.push_back(item);
239 result.items.push_back(element);
291 template<
typename source_t>
302 template<
typename source_t>
303 [[nodiscard]]
static auto as_enumerable(std::initializer_list<source_t> source)
noexcept {
304 auto result = __opaque_xtd_linq_enumerable_collection__<source_t> {};
305 for (
const auto& item : source)
306 result.items.push_back(item);
316 template<
typename collection_t>
318#if defined(__xtd__cpp_lib_ranges)
319 using source_t = std::ranges::range_value_t<collection_t>;
321 using source_t =
typename collection_t::value_type;
323 auto result = __opaque_xtd_linq_enumerable_collection__<source_t> {};
324 for (
auto&& item : source)
325 result.items.push_back(item);
336 template<
typename input_iterator_t>
338 using source_t =
typename std::decay<
decltype(*first)>
::type;
339 auto result = __opaque_xtd_linq_enumerable_collection__<source_t> {};
352 template<
typename input_iterator_t>
364 template<
typename source_t, xtd::usize length>
370 template<xtd::usize size_>
371 [[nodiscard]]
static auto as_enumerable(std::bitset<size_> source);
372 template<
typename source_t,
typename container_t>
373 static auto as_enumerable(std::queue<source_t, container_t> source)
noexcept {
374 struct accessor :
public std::queue<source_t> {
static auto get() {
return &accessor::c;}};
375 const auto& underlying_items = source.*accessor::get();
376 return as_enumerable(underlying_items.begin(), underlying_items.end());
378 template<
typename source_t,
typename container_t>
379 [[nodiscard]]
static auto as_enumerable(std::priority_queue<source_t, container_t> source)
noexcept {
380 struct accessor :
public std::priority_queue<source_t> {
static auto get() {
return &accessor::c;}};
381 const auto& underlying_items = source.*accessor::get();
382 return as_enumerable(underlying_items.begin(), underlying_items.end());
384 template<
typename source_t,
typename container_t>
385 [[nodiscard]]
static auto as_enumerable(std::stack<source_t, container_t> source)
noexcept {
386 struct accessor :
public std::stack<source_t> {
static auto get() {
return &accessor::c;}};
387 const auto& underlying_items = source.*accessor::get();
388 return as_enumerable(underlying_items.begin(), underlying_items.end());
446 template<
typename result_t,
typename source_t>
455 template<
typename source_t>
463 template<
typename source_t>
465 auto result = __opaque_xtd_linq_enumerable_collection__<source_t> {};
466 for (
const auto& item :
first)
467 result.items.push_back(item);
468 for (
const auto& item : second)
469 result.items.push_back(item);
478 template<
typename source_t>
480 for (
const auto& item : source)
481 if (item == value)
return true;
491 template<
typename source_t>
493 for (
const auto& item : source)
494 if (comparer.
equals(item, value))
return true;
505 template<
typename source_t>
521 template<
typename source_t>
531 template<
typename source_t>
533 return count<source_t>(source, [value](
const source_t& item) ->
bool {
return item == value;});
545 template<
typename key_t,
typename source_t>
560 template<
typename key_t,
typename source_t>
562 auto result = __opaque_xtd_linq_enumerable_collection__<key_value_pair<key_t, xtd::usize>> {};
566 auto key = key_selector(
enumerator.current());
568 for (; index < keys.count(); ++index)
569 if (key_comparer.equals(keys[index], key))
break;
570 if (index < keys.count()) result.items[index] = {key, result.items[index].value() + 1};
573 result.items.push_back({key, 1});
586 template<
typename source_t>
599 template<
typename source_t>
601 auto result = __opaque_xtd_linq_enumerable_collection__<source_t> {};
602 if (!
any(source)) result.items.push_back(default_value);
603 else for (
const auto& item : source)
604 result.items.push_back(item);
611 template<
typename source_t>
613 auto result = __opaque_xtd_linq_enumerable_collection__<source_t> {};
614 for (
const auto& item : source)
616 result.items.push_back(item);
624 template<
typename source_t>
626 auto result = __opaque_xtd_linq_enumerable_collection__<source_t> {};
627 for (
const auto& item : source)
628 if (!
contains(result, item, comparer))
629 result.items.push_back(item);
639 template<
typename source_t>
642 return any(result) ? *result.begin() : default_value;
649 template<
typename source_t>
658 template<
typename source_t>
660 return any(source) ? *source.begin() : default_value;
666 template<
typename source_t>
679 template<
typename source_t>
691 template<
typename source_t>
692 [[nodiscard]]
static auto from(std::initializer_list<source_t> source)
noexcept {
703 template<
typename collection_t>
704 [[nodiscard]]
static auto from(collection_t&& source)
noexcept {
718 template<
typename input_iterator_t>
719 [[nodiscard]]
static auto from(input_iterator_t
first, input_iterator_t
last)
noexcept {
731 template<
typename input_iterator_t>
744 template<
typename source_t, xtd::usize length>
750 template<
typename source_t,
typename container_t>
751 [[nodiscard]]
static auto from(std::queue<source_t, container_t> source)
noexcept {
754 template<
typename source_t,
typename container_t>
755 [[nodiscard]]
static auto from(std::stack<source_t, container_t> source)
noexcept {
760 template<
typename result_t,
typename source_t>
763 auto result = std::optional<result_t> {};
764 for (
const auto& item : source) {
765 auto val = selector(item);
766 if (!result || val > result) result = val;
768 return result.value_or(result_t {});
771 template<
typename source_t>
772 requires xtd::numeric<source_t>
774 auto result = std::optional<source_t> {};
775 for (
const auto& item : source) {
776 auto val = selector(item);
777 if (!result || val > result) result = val;
779 return result.value_or(source_t {});
782 template<
typename source_t>
783 requires xtd::numeric<source_t>
785 auto result = std::optional<source_t> {};
786 for (
const auto& item : source)
787 if (!result || item > result) result = item;
788 return result.value_or(source_t {});
791 template<
typename result_t,
typename source_t>
792 requires xtd::numeric<result_t>
794 auto result = std::optional<result_t> {};
795 for (
const auto& item : source) {
796 auto val = selector(item);
797 if (!result || val < result) result = val;
799 return result.value_or(result_t {});
802 template<
typename source_t>
803 requires xtd::numeric<source_t>
805 auto result = std::optional<source_t> {};
806 for (
const auto& item : source) {
807 auto val = selector(item);
808 if (!result || val < result) result = val;
810 return result.value_or(source_t {});
813 template<
typename source_t>
814 requires xtd::numeric<source_t>
816 auto result = std::optional<source_t> {};
817 for (
const auto& item : source)
818 if (!result || item < result) result = item;
819 return result.value_or(source_t {});
825 template<
typename source_t>
833 template<
typename source_t>
835 auto result = __opaque_xtd_linq_enumerable_collection__<source_t> {};
836 for (
const auto& item : source)
837 result.items.push_back(item);
848 template<
typename key_t,
typename source_t>
850 auto result = __opaque_xtd_linq_enumerable_collection__<source_t> {};
851 for (
const auto& item : source)
852 result.items.push_back(item);
853 std::sort(result.items.begin(), result.items.end(), [key_selector](
const source_t&
a,
const source_t&
b) {return key_selector(a) < key_selector(b);});
863 template<
typename source_t>
865 auto result = __opaque_xtd_linq_enumerable_collection__<source_t> {};
866 for (
const auto& item : source)
867 result.items.push_back(item);
868 std::sort(result.items.begin(), result.items.end(), [key_selector](
const source_t&
a,
const source_t&
b) {return key_selector(a) < key_selector(b);});
878 template<
typename key_t,
typename source_t>
880 auto result = __opaque_xtd_linq_enumerable_collection__<source_t> {};
881 for (
const auto& item : source)
882 result.items.push_back(item);
883 std::sort(result.items.begin(), result.items.end(), [key_selector](
const source_t&
a,
const source_t&
b) {return key_selector(a) > key_selector(b);});
893 template<
typename source_t>
895 auto result = __opaque_xtd_linq_enumerable_collection__<source_t> {};
896 for (
const auto& item : source)
897 result.items.push_back(item);
898 std::sort(result.items.begin(), result.items.end(), [key_selector](
const source_t&
a,
const source_t&
b) {return key_selector(a) > key_selector(b);});
909 template<
typename type_t>
911 auto step = type_t {};
922 template<
typename type_t>
923 [[nodiscard]]
static auto range(type_t start, type_t
count) {
924 auto step = type_t {};
933 template<
typename type_t>
934 [[nodiscard]]
static auto range(type_t start, type_t
count, type_t step) {
938 auto result = __opaque_xtd_linq_enumerable_collection__<type_t> {};
939 for (
auto index = type_t {}; index <
count; ++index)
940 result.items.push_back(start + (index * step));
953 template<
typename result_t,
typename source_t>
955 auto result = __opaque_xtd_linq_enumerable_collection__<result_t> {};
957 for (
const auto& item : source)
958 result.items.push_back(invoke_selector_wtih_optional_index(selector, item, index++));
970 template<
typename source_t>
972 auto result = __opaque_xtd_linq_enumerable_collection__<source_t> {};
974 for (
const auto& item : source)
975 result.items.push_back(invoke_selector_wtih_optional_index(selector, item, index++));
987 template<
typename source_t>
998 template<
typename source_t>
1012 template<
typename source_t>
1014 auto result = __opaque_xtd_linq_enumerable_collection__<source_t> {};
1016 for (
const auto& item : source)
1017 if (invoke_predicate_wtih_optional_index(
predicate, item, index++)) result.items.push_back(item);
1023 template <
typename predicate_t,
typename source_t>
1024 static constexpr bool invoke_predicate_wtih_optional_index(predicate_t&&
predicate, source_t&& value,
xtd::usize index) {
1029 template <
typename selector_t,
typename source_t>
1030 static auto invoke_selector_wtih_optional_index(selector_t&& selector, source_t&& value,
xtd::usize index) {
1031 if constexpr (
requires { selector(value, index); })
return selector(value, index);
1032 else return selector(value);
Contains xtd::collections::generic::helpers::allocator alias.
Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the ba...
Definition array.hpp:64
static const comparer< xtd::any_object > default_comparer
Definition comparer.hpp:50
static auto default_equality_comparer() -> const equality_comparer &
Gets the default equality comparer for the type specified by the generic argument.
Definition equality_comparer.hpp:42
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:80
static auto throws(xtd::helpers::exception_case exception_case, const source_location &location=source_location::current()) -> void
Throws an exption with specified exception case.
Provides a set of static methods for querying objects that implement ienumerable <type_t>.
Definition enumerable.hpp:68
static auto count(const ienumerable< source_t > &source, const std::function< bool(const source_t &)> &predicate) noexcept -> xtd::usize
Returns a number that represents how many elements in the specified sequence satisfy a condition.
Definition enumerable.hpp:522
static auto average(const ienumerable< double > &source) -> double
Computes the average of a sequence of double values.
static auto count_by(const ienumerable< source_t > &source, const std::function< key_t(const source_t &)> &key_selector, const iequality_comparer< key_t > &key_comparer) noexcept
Returns the count of elements in the source sequence grouped by key.
Definition enumerable.hpp:561
static auto default_if_empty(const ienumerable< source_t > &source) noexcept
Returns the elements of the specified sequence or the type parameter's default value in a singleton c...
Definition enumerable.hpp:587
static auto append(const ienumerable< source_t > &source, const source_t &element) noexcept
Appends a value to the end of the sequence.
Definition enumerable.hpp:235
static auto order_by_descending(const ienumerable< source_t > &source, const std::function< source_t(const source_t &)> &key_selector)
Sorts the elements of a sequence in descending order according to a key.
Definition enumerable.hpp:894
static auto from(input_iterator_t first, input_iterator_t last) noexcept
Returns the input typed as xtd::collections::generic::ienumerable <type_t>.
Definition enumerable.hpp:719
static auto aggregate(const ienumerable< source_t > &source, const accumulate_t &seed, const std::function< accumulate_t(const accumulate_t &, const source_t &)> &func) -> accumulate_t
Applies an accumulator function over a sequence. The specified seed value is used as the initial accu...
Definition enumerable.hpp:141
static auto any(const ienumerable< source_t > &source) noexcept -> bool
Determines whether a sequence contains any elements.
Definition enumerable.hpp:208
static auto average(const ienumerable< xtd::optional< xtd::int32 > > &source) noexcept -> xtd::optional< double >
Computes the average of a sequence of optional xtd::int32 values.
typename xtd::collections::generic::ienumerable< type_t > ienumerable
Represents the ienumerable value type.
Definition enumerable.hpp:83
static auto first_or_default(const ienumerable< source_t > &source) noexcept -> source_t
Returns the first element of the sequence that satisfies a condition or a default value if no such el...
Definition enumerable.hpp:667
static auto from(input_iterator_t iterator, xtd::usize length) noexcept
Returns the input typed as xtd::collections::generic::ienumerable <type_t>.
Definition enumerable.hpp:732
typename xtd::collections::generic::enumerator< type_t > enumerator
Represents the enumerator value type.
Definition enumerable.hpp:75
static auto cast(const ienumerable< source_t > &source) noexcept
Casts the elements of an xtd::collections::generic::ienumerable to the specified type.
static auto from(const source_t(&array)[length]) noexcept
Returns the input typed as xtd::collections::generic::ienumerable <type_t>.
Definition enumerable.hpp:745
static auto average(const ienumerable< xtd::optional< xtd::int64 > > &source) noexcept -> xtd::optional< double >
Computes the average of a sequence of optional xtd::int64 values.
static auto as_enumerable(input_iterator_t first, input_iterator_t last) noexcept
Returns the input typed as xtd::collections::generic::ienumerable <type_t>.
Definition enumerable.hpp:337
static auto average(const ienumerable< xtd::optional< float > > &source) noexcept -> xtd::optional< float >
Computes the average of a sequence of optional float values.
static auto aggregate(const ienumerable< source_t > &source, const source_t &seed, const std::function< source_t(const source_t &, const source_t &)> &func, const std::function< source_t(const source_t &)> &result_selector) -> source_t
Applies an accumulator function over a sequence. The specified seed value is used as the initial accu...
Definition enumerable.hpp:158
static auto to_list(const ienumerable< source_t > &source) noexcept
Creates a xtd::collections::generic::list <type_t> from an xtd::collections::generic::ienumerable <ty...
static const auto & as_enumerable(const ienumerable< source_t > &source) noexcept
Returns the input typed as xtd::collections::generic::ienumerable <type_t>.
Definition enumerable.hpp:292
typename xtd::collections::generic::iequality_comparer< type_t > iequality_comparer
Represents the ienumerable value type.
Definition enumerable.hpp:79
static auto count(const ienumerable< source_t > &source) noexcept -> xtd::usize
Returns the number of elements in a sequence.
Definition enumerable.hpp:506
static auto aggregate(const ienumerable< source_t > &source, const std::function< source_t(const source_t &, const source_t &)> &func) -> source_t
Applies an accumulator function over a sequence.
Definition enumerable.hpp:106
static auto distinct(const ienumerable< source_t > &source, const xtd::collections::generic::iequality_comparer< source_t > &comparer) noexcept
Returns distinct elements from a sequence by using a specified xtd::collections::generic::iequality_c...
Definition enumerable.hpp:625
static auto range(type_t start, type_t count)
Generates a sequence of integral numbers within a specified range.
Definition enumerable.hpp:923
typename xtd::collections::generic::list< type_t > list
Represents the list value type.
Definition enumerable.hpp:87
static auto average(const ienumerable< xtd::optional< double > > &source) noexcept -> xtd::optional< double >
Computes the average of a sequence of optional double values.
static auto average(const ienumerable< float > &source) -> float
Computes the average of a sequence of float values.
static auto average(const ienumerable< xtd::optional< xtd::decimal > > &source) noexcept -> xtd::optional< xtd::decimal >
Computes the average of a sequence of optional xtd::decimal values.
static auto as_enumerable(input_iterator_t iterator, xtd::usize length) noexcept
Returns the input typed as xtd::collections::generic::ienumerable <type_t>.
Definition enumerable.hpp:353
static auto all(const ienumerable< source_t > &source, const std::function< bool(const source_t &)> &predicate) -> bool
Determines whether all elements of a sequence satisfy a condition.
Definition enumerable.hpp:193
static auto select(const ienumerable< source_t > &source, auto &&selector)
Projects each element of a sequence into a new form by incorporating the element's index.
Definition enumerable.hpp:971
static auto first_or_default(const ienumerable< source_t > &source, const std::function< bool(const source_t &)> &predicate, const source_t &default_value) noexcept -> source_t
Returns the first element of the sequence that satisfies a condition, or a specified default value if...
Definition enumerable.hpp:640
static auto average(const ienumerable< xtd::decimal > &source) -> xtd::decimal
Computes the average of a sequence of xtd::decimal values.
static auto to_array(const ienumerable< source_t > &source) noexcept
Creates a xtd::array <type_t> from an xtd::collections::generic::ienumerable <type_t>.
static auto order(const ienumerable< source_t > &source, const xtd::collections::generic::icomparer< source_t > &comparer)
Sorts the elements of a sequence in ascending order.
Definition enumerable.hpp:834
static auto first_or_default(const ienumerable< source_t > &source, const source_t &default_value) noexcept -> source_t
Returns the first element of the sequence that satisfies a condition or a default value if no such el...
Definition enumerable.hpp:659
static auto aggregate(const ienumerable< source_t > &source, const accumulate_t &seed, const std::function< accumulate_t(const accumulate_t &, const source_t &)> &func, const std::function< result_t(const accumulate_t &)> &result_selector) -> result_t
Applies an accumulator function over a sequence. The specified seed value is used as the initial accu...
Definition enumerable.hpp:177
static auto from(std::initializer_list< source_t > source) noexcept
Returns the input typed as xtd::collections::generic::ienumerable <type_t>.
Definition enumerable.hpp:692
static auto default_if_empty(const ienumerable< source_t > &source, const source_t &default_value) noexcept
Returns the elements of the specified sequence or the specified value in a singleton collection if th...
Definition enumerable.hpp:600
static auto average(const ienumerable< xtd::int32 > &source) -> double
Computes the average of a sequence of xtd::int32 values.
static auto concat(const ienumerable< source_t > &first, const ienumerable< source_t > &second) noexcept
Concatenates two sequences.
Definition enumerable.hpp:464
static auto range(type_t start, type_t count, type_t step)
Generates a sequence of integral numbers within a specified range and step.
Definition enumerable.hpp:934
static auto order_by_descending(const ienumerable< source_t > &source, const std::function< key_t(const source_t &)> &key_selector)
Sorts the elements of a sequence in descending order according to a key.
Definition enumerable.hpp:879
static auto distinct(const ienumerable< source_t > &source) noexcept
Returns distinct elements from a sequence by using the default equality comparer to compare values.
Definition enumerable.hpp:612
static auto contains(const ienumerable< source_t > &source, const source_t &value) noexcept -> bool
Determines whether a sequence contains a specified element by using the default equality comparer.
Definition enumerable.hpp:479
static auto as_enumerable(const source_t(&array)[length]) noexcept
Returns the input typed as xtd::collections::generic::ienumerable <type_t>.
Definition enumerable.hpp:365
static auto order_by(const ienumerable< source_t > &source, const std::function< source_t(const source_t &)> &key_selector)
Sorts the elements of a sequence in ascending order according to a key.
Definition enumerable.hpp:864
static auto order_by(const ienumerable< source_t > &source, const std::function< key_t(const source_t &)> &key_selector)
Sorts the elements of a sequence in ascending order according to a key.
Definition enumerable.hpp:849
static auto aggregate(const ienumerable< source_t > &source, const source_t &seed, const std::function< source_t(const source_t &, const source_t &)> &func) -> source_t
Applies an accumulator function over a sequence. The specified seed value is used as the initial accu...
Definition enumerable.hpp:124
static auto order(const ienumerable< source_t > &source)
Sorts the elements of a sequence in ascending order.
Definition enumerable.hpp:826
static auto from(collection_t &&source) noexcept
Returns the input typed as xtd::collections::generic::ienumerable <type_t>.
Definition enumerable.hpp:704
static auto contains(const ienumerable< source_t > &source, const source_t &value, const xtd::collections::generic::iequality_comparer< source_t > &comparer) noexcept -> bool
Determines whether a sequence contains a specified element by using a specified equality comparer.
Definition enumerable.hpp:492
static auto where(const ienumerable< source_t > &source, auto &&predicate)
Filters a sequence of values based on a predicate.
Definition enumerable.hpp:1013
static auto count_by(const ienumerable< source_t > &source, const std::function< key_t(const source_t &)> &key_selector) noexcept
Returns the count of elements in the source sequence grouped by key.
Definition enumerable.hpp:546
xtd::collections::generic::key_value_pair< key_t, value_t > key_value_pair
Represents the key value pair value type.
Definition enumerable.hpp:91
static auto first_or_default(const ienumerable< source_t > &source, const std::function< bool(const source_t &)> &predicate) noexcept -> source_t
Returns the first element of the sequence that satisfies a condition or a default value if no such el...
Definition enumerable.hpp:650
static auto range(type_t count)
Generates a sequence of integral numbers within a specified range.
Definition enumerable.hpp:910
static auto as_enumerable(std::initializer_list< source_t > source) noexcept
Returns the input typed as xtd::collections::generic::ienumerable <type_t>.
Definition enumerable.hpp:303
static auto any(const ienumerable< source_t > &source, const std::function< bool(const source_t &)> &predicate) -> bool
Determines whether any element of a sequence satisfies a condition.
Definition enumerable.hpp:220
static auto average(const ienumerable< xtd::int64 > &source) -> double
Computes the average of a sequence of xtd::int64 values.
static auto chunk(const ienumerable< source_t > &source, xtd::usize size)
Splits the elements of a sequence into chunks of size at most size.
static auto count(const ienumerable< source_t > &source, const source_t &value) noexcept -> xtd::usize
Returns the number of elements with the specified value.
Definition enumerable.hpp:532
static auto select(const ienumerable< source_t > &source, auto &&selector)
Projects each element of a sequence into a new form.
Definition enumerable.hpp:954
static const auto & from(const ienumerable< source_t > &source) noexcept
Returns the input typed as xtd::collections::generic::ienumerable <type_t>.
Definition enumerable.hpp:680
static auto as_enumerable(collection_t &&source) noexcept
Returns the input typed as xtd::collections::generic::ienumerable <type_t>.
Definition enumerable.hpp:317
virtual auto equals(const object &obj) const noexcept -> bool
Determines whether the specified object is equal to the current object.
Contains xtd::collections::generic::extensions::enumerable <type_t> class.
Definition numeric.hpp:12
Contains xtd::decimal type.
Contains xtd::collections::generic::equality_comparer <type_t> class.
Contains xtd::linq::from methods.
Contains xtd::collections::generic::comparer <type_t> class.
Contains xtd::collections::generic::enumerator <type_t> class.
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
@ argument
The argument is not valid.
Definition exception_case.hpp:31
@ argument_out_of_range
The argument is out of range.
Definition exception_case.hpp:35
#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
long double decimal
Represents a decimal-precision floating-point number.
Definition decimal.hpp:23
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
std::any any
Represents the any alias on std::any.
Definition any.hpp:24
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
@ a
The A key.
Definition console_key.hpp:88
@ b
The B key.
Definition console_key.hpp:90
Contains xtd::iequatable interface.
Contains xtd::int32 type.
Contains xtd::int64 type.
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:51
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8
const xtd::collections::generic::helpers::wrap_pointer_iterator< pointer > iterator
Represents the iterator of read_only_span value type.
Definition read_only_span.hpp:71
auto first() const -> read_only_span< type_t, count >
Obtains a subspan consisting of the first count elements of the sequence.
Definition read_only_span.hpp:249
auto last() const -> read_only_span< type_t, count >
Obtains a subspan consisting of the last N elements of the sequence.
Definition read_only_span.hpp:274
constexpr auto length() const noexcept -> size_type
Returns the length of the current read_only_span.
Definition read_only_span.hpp:213
constexpr auto size() const noexcept -> size_type
Returns the number of elements.
Definition read_only_span.hpp:217
Contains xtd::numeric concept.
Contains xtd::optional type.
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
Implements a function object for compare data.
Definition lesser.hpp:39
Defines a key/value pair that can be set or retrieved.
Definition key_value_pair.hpp:37
Contains xtd::usize type.