5#define __XTD_CORE_INTERNAL__
7#undef __XTD_CORE_INTERNAL__
28#define __XTD_ARRAY_INTERNAL__
31#undef __XTD_ARRAY_INTERNAL__
63 template<
class type_t, xtd::size rank_,
class allocator_t>
64 class array :
public basic_array<type_t, allocator_t> {
108 array(
const array& array) :
xtd::basic_array<type_t, allocator_t>(array) {}
111 array(array&& array) :
xtd::basic_array<type_t, allocator_t>(std::move(array)) {}
118 explicit array(
const array<xtd::size, 1>& lengths) :
xtd::basic_array<type_t, allocator_t>(lengths) {}
125 array(
const array<xtd::size, 1>& lengths,
const type_t& value) :
xtd::basic_array<type_t, allocator_t>(lengths, value) {}
139 explicit array(
const xtd::collections::generic::ilist<type_t>& list) : basic_array<type_t, allocator_t>(list) {}
143 template<
class input_iterator_t>
147 array(std::initializer_list<type_t>
items) : basic_array<type_t, allocator_t>(
items) {}
175 array& operator=(const array&) = default;
179 array& operator=(array&&) = default;
183 friend class array<>;
184 array(const array<
xtd::
size>& lengths,
bool) : basic_array<type_t, allocator_t>(lengths) {}
188#define __XTD_ARRAY_INTERNAL__
194#undef __XTD_ARRAY_INTERNAL__
195#define __XTD_CORE_INTERNAL__
197#undef __XTD_CORE_INTERNAL__
200template<
class source_t>
203 auto chunks = __opaque_xtd_linq_enumerable_collection__<xtd::array<source_t>> {};
204 chunks = __opaque_xtd_linq_enumerable_collection__<xtd::array<source_t>> {};
205 auto chunk = std::vector<source_t> {};
206 for (
auto index =
size_t {0};
const auto& item : source) {
207 chunk.push_back(item);
208 if (++index %
size == 0) {
209 chunks.items.push_back(
chunk);
210 chunk = std::vector<source_t> {};
213 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.
array(const array< xtd::size, 1 > &lengths)
Initializes a new instance of the array class with lengths for each rank specified.
Definition array.hpp:118
typename xtd::basic_array< xtd::string, allocator_t >::difference_type difference_type
Definition array.hpp:78
typename xtd::basic_array< xtd::string, allocator_t >::const_pointer const_pointer
Definition array.hpp:86
array(const array< xtd::size, 1 > &lengths, const type_t &value)
Initializes a new instance of the array class with lengths for each rank specified.
Definition array.hpp:125
typename xtd::basic_array< xtd::string, allocator_t >::const_reference const_reference
Definition array.hpp:82
xtd::size rank() const noexcept override
Gets the rank (number of dimensions) of the array.
Definition array.hpp:158
typename xtd::basic_array< xtd::string, allocator_t >::size_type size_type
Definition array.hpp:76
array(input_iterator_t first, input_iterator_t last)
Constructs the container with the contents of the range [first, last).
Definition array.hpp:144
typename xtd::basic_array< xtd::string, allocator_t >::pointer pointer
Definition array.hpp:84
array()=default
Initializes a new instance of the array class that is empty.
xtd::string value_type
Definition array.hpp:70
typename xtd::basic_array< xtd::string, allocator_t >::reverse_iterator reverse_iterator
Definition array.hpp:92
typename xtd::basic_array< xtd::string, allocator_t >::iterator iterator
Definition array.hpp:88
array(array &&array)
Move constructor with specified array.
Definition array.hpp:111
array(const array &array)
Copy constructor with specified array.
Definition array.hpp:108
typename xtd::basic_array< xtd::string, allocator_t >::const_iterator const_iterator
Definition array.hpp:90
typename xtd::basic_array< xtd::string, allocator_t >::allocator_type allocator_type
Definition array.hpp:72
array(const xtd::collections::generic::ienumerable< type_t > &enumerable)
Initializes a new instance of the array and copy array array specified.
Definition array.hpp:132
array(const xtd::collections::generic::ilist< type_t > &list)
Initializes a new instance of the array and copy array array specified.
Definition array.hpp:139
typename xtd::basic_array< xtd::string, allocator_t >::base_type base_type
Definition array.hpp:74
typename xtd::basic_array< xtd::string, allocator_t >::reference reference
Definition array.hpp:80
typename xtd::basic_array< xtd::string, allocator_t >::const_reverse_iterator const_reverse_iterator
Definition array.hpp:94
array(std::initializer_list< type_t > items)
Constructs the container with the contents of the specified initializer list.
Definition array.hpp:147
xtd::string to_string() const noexcept override
Returns a xtd::string that represents the current object.
const value_type & const_reference
Represents the const reference of array value type.
Definition basic_array.hpp:45
xtd::collections::generic::helpers::allocator< value_type > allocator_type
Represents the array allocator type.
Definition basic_array.hpp:35
typename xtd::collections::generic::ienumerable< type_t >::const_iterator const_iterator
Represents the const iterator of array value type.
Definition basic_array.hpp:53
xtd::ptrdiff difference_type
Represents the array difference type (usually xtd::ptrdiff).
Definition basic_array.hpp:41
const value_type * const_pointer
Represents the const pointer of array value type.
Definition basic_array.hpp:49
typename xtd::collections::generic::helpers::raw_array< value_type >::reverse_iterator reverse_iterator
Represents the reverse iterator of array value type.
Definition basic_array.hpp:55
value_type * pointer
Represents the pointer of array value type.
Definition basic_array.hpp:47
value_type & reference
Represents the reference of array value type.
Definition basic_array.hpp:43
typename xtd::collections::generic::helpers::raw_array< value_type, allocator_type >::base_type base_type
Represents the array base type.
Definition basic_array.hpp:37
virtual const base_type & items() const noexcept
Returns the underlying base type items.
Definition basic_array.hpp:113
typename xtd::collections::generic::helpers::raw_array< value_type >::const_reverse_iterator const_reverse_iterator
Represents the const reverse iterator of array value type.
Definition basic_array.hpp:57
typename xtd::collections::generic::ienumerable< type_t >::iterator iterator
Represents the iterator of array value type.
Definition basic_array.hpp:51
xtd::size size_type
Represents the array size type (usually xtd::size).
Definition basic_array.hpp:39
Exposes the enumerator, which supports a simple iteration over a collection of a specified type.
Definition ienumerable.hpp:40
static void throws(xtd::helpers::exception_case exception_case, const source_location &location=source_location::current())
Throws an exption with specified exception case.
static auto chunk(const ienumerable< source_t > &source, xtd::size size)
Splits the elements of a sequence into chunks of size at most size.
Contains core_export_ keyword.
Contains xtd::collections::generic::helpers::equator struct.
Contains xtd::collections::generic::comparer <type_t> class.
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.
Definition exception_case.hpp:35
xtd::basic_string< char > string
Represents text as a sequence of UTF-8 code units.
Definition __string_definitions.hpp:43
size_t size
Represents a size of any object in bytes.
Definition size.hpp:23
Contains xtd::iequatable interface.
Contains xtd::int64 type.
Contains xtd::collections::generic::helpers::lesser struct.
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8
read_only_span< type_t, count > first() const
Obtains a subspan consisting of the first count elements of the sequence.
Definition read_only_span.hpp:282
read_only_span< type_t, count > last() const
Obtains a subspan consisting of the last N elements of the sequence.
Definition read_only_span.hpp:307
Contains xtd::new_ptr method.
Contains xtd::null pointer valiue.
Contains xtd::object class.
Contains xtd::collections::generic::helpers::raw_array class.
Contains xtd::static_object class.
Contains xtd::helpers::throw_helper class.