6#if !defined(__XTD_ARRAY_INTERNAL__)
7#error "Do not include this file: Internal use only. Include <xtd/array> or <xtd/array.h> instead."
18 template<
class type_t, xtd::size rank = 1,
class allocator_t = xtd::collections::
generic::helpers::allocator<type_to_array_t<type_t>>>
19 array(type_t, type_t, allocator_t = allocator_t()) -> array<type_t, rank, allocator_t>;
21 template<
class type_t, xtd::size rank = 1,
class allocator_t = xtd::collections::
generic::helpers::allocator<type_to_array_t<type_t>>>
22 array(std::initializer_list<type_t>) -> array<type_t, rank, allocator_t>;
24 template<
class type_t, xtd::size length, xtd::size rank = 1,
class allocator_t = xtd::collections::
generic::helpers::allocator<type_to_array_t<type_t>>>
25 array(
const type_t(&
a)[length]) -> array<type_t, rank, allocator_t>;
27 template<
class type_t, xtd::size rank = 1,
class allocator_t = xtd::collections::
generic::helpers::allocator<type_to_array_t<type_t>>>
30 template<
class type_t, xtd::size rank = 1,
class allocator_t = xtd::collections::
generic::helpers::allocator<type_to_array_t<type_t>>>
33 template<
class type_t, xtd::size rank = 1,
class allocator_t = xtd::collections::
generic::helpers::allocator<type_to_array_t<type_t>>>
34 array(
const std::vector<type_t>&) -> array<type_t, rank, allocator_t>;
36 template<
class type_t, xtd::size rank = 1,
class allocator_t = xtd::collections::
generic::helpers::allocator<type_to_array_t<type_t>>>
37 array(
const array<type_t, rank, allocator_t>&) -> array<type_t, rank, allocator_t>;
39 template<
class type_t, xtd::size rank = 1,
class allocator_t = xtd::collections::
generic::helpers::allocator<type_to_array_t<type_t>>>
40 array(std::vector<type_t>&&) -> array<type_t, rank, allocator_t>;
42 template<
class type_t, xtd::size rank = 1,
class allocator_t = xtd::collections::
generic::helpers::allocator<type_to_array_t<type_t>>>
43 array(array<type_t, rank, allocator_t>&&) -> array<type_t, rank, allocator_t>;
47template<
class type_t,
class allocator_t>
49 return operator()(indexes);
52template<
class type_t,
class allocator_t>
57template<
class type_t,
class allocator_t>
60 for (
auto index1 =
xtd::size {0}; index1 < indexes.
size(); ++index1) {
63 for (
auto index2 = index1 + 1; index2 < indexes.
size(); ++index2)
64 multiplicand *= get_length(index2);
65 position += indexes[index1] * multiplicand;
68 return data_->items[position];
71template<
class type_t,
class allocator_t>
74 for (
auto index1 =
xtd::size {0}; index1 < indexes.
size(); ++index1) {
77 for (
auto index2 = index1 + 1; index2 < indexes.
size(); ++index2)
78 multiplicand *= get_length(index2);
79 position += indexes[index1] * multiplicand;
82 return data_->items[position];
85template<
class type_t,
class allocator_t>
87 data_->
items = base_type(std::accumulate(lengths.begin(), lengths.end(), size_type {0}));
88 data_->lower_bound.clear();
89 data_->upper_bound.clear();
90 for (
auto length : lengths) {
91 data_->lower_bound.push_back(0);
92 data_->upper_bound.push_back(length - 1);
97template<
class type_t,
class allocator_t>
Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the ba...
Definition array.hpp:59
Base object that represent array.
Definition basic_array.hpp:44
const value_type & get_value(const xtd::array< size_type > &indexes) const
Gets the value at the specified position in the multidimensional array. The indexes are specified as ...
virtual const base_type & items() const noexcept
Returns the underlying base type items.
Definition basic_array.hpp:181
xtd::string to_string() const noexcept override
Returns a xtd::string that represents the current object.
type_t & operator()(const xtd::array< size_type > &indexes)
Gets the value at the specified position in the multidimensional array. The indexes are specified as ...
virtual size_type size() const noexcept
Returns the number of elements in the container, i.e. std::distance(xtd::array::begin(),...
Definition basic_array.hpp:229
Represents text as a sequence of character units.
Definition basic_string.hpp:71
static basic_string join(const basic_string separator, const collection_t &values) noexcept
Concatenates a specified separator basic_string between each element of a specified object array,...
Definition basic_string.hpp:2288
Exposes the enumerator, which supports a simple iteration over a collection of a specified type.
Definition ienumerable.hpp:36
Represents a collection of objects that can be individually accessed by index.
Definition ilist.hpp:41
Provides the base class for a generic read-only collection.
Definition read_only_collection.hpp:38
static void throws(xtd::helpers::exception_case exception_case, const source_location &location=source_location::current())
Throws an exption with specified exception case.
@ index_out_of_range
The index is out of range.
size_t size
Represents a size of any object in bytes.
Definition size.hpp:23
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10
Contains xtd::collections::object_model::read_only_collection class.
Contains xtd::string alias.