5#define __XTD_CORE_INTERNAL__
7#undef __XTD_CORE_INTERNAL__
23#define __XTD_ARRAY_INTERNAL__
26#undef __XTD_ARRAY_INTERNAL__
58 template<
class type_t, xtd::size rank_,
class allocator_t>
82 array(array&& array) =
default;
104#define __XTD_ARRAY_INTERNAL__
110#undef __XTD_ARRAY_INTERNAL__
111#define __XTD_CORE_INTERNAL__
113#undef __XTD_CORE_INTERNAL__
116template<
class source_t>
119 static thread_local auto chunks = __opaque_xtd_linq_enumerable_collection__<xtd::array<source_t>> {};
120 chunks = __opaque_xtd_linq_enumerable_collection__<xtd::array<source_t>> {};
121 auto chunk = std::vector<source_t> {};
122 for (
auto index =
size_t {0};
const auto& item : source) {
123 chunk.push_back(item);
124 if (++index %
size == 0) {
125 chunks.items.push_back(
chunk);
126 chunk = std::vector<source_t> {};
129 if (
chunk.size() != 0) chunks.items.push_back(
chunk);
Contains xtd::array definitions.
Contains xtd::abstract_object class.
Contains xtd::array <type_t, 1> class.
Contains xtd::array <type_t, 2> class.
Contains xtd::array <type_t, 3> class.
Contains xtd::array class.
Contains xtd::array_abstract_object class.
Contains xtd::array <> class.
Contains xtd::basic_array class.
Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the ba...
Definition array.hpp:59
array(const array< xtd::size, 1 > &lengths)
Initializes a new instance of the array class with lengths for each rank specified.
Definition array.hpp:77
xtd::size rank() const noexcept override
Gets the rank (number of dimensions) of the array.
Definition array.hpp:88
array()=default
Initializes a new instance of the array class that is empty.
Base object that represent array.
Definition basic_array.hpp:44
static void throws(xtd::helpers::exception_case exception_case, const source_location &location=source_location::current())
Throws an exption with specified exception case.
static const ienumerable< xtd::array< source_t > > & chunk(const ienumerable< source_t > &source, xtd::size size)
Splits the elements of a sequence into chunks of size at most size.
typename xtd::collections::generic::ienumerable< type_t > ienumerable
Represents the ienumerable value type.
Definition enumerable.hpp:66
Contains core_export_ keyword.
Contains xtd::collections::generic::helpers::equator struct.
Contains xtd::collections::generic::enumerator <type_t> class.
Contains xtd::collections::generic::icomparer <type_t> interface.
Contains xtd::collections::generic::ilist <type_t> interface.
@ argument_out_of_range
The argument is out of range.
size_t size
Represents a size of any object in bytes.
Definition size.hpp:23
Contains xtd::iequatable interface.
Contains xtd::int64 type.
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10
Contains xtd::new_ptr method.
Contains xtd::object class.
Contains xtd::static_object class.
Contains xtd::helpers::exception_case enum class.