xtd 0.2.0
Loading...
Searching...
No Matches
basic_array.hpp
Go to the documentation of this file.
1
4
5#if !defined(__XTD_ARRAY_INTERNAL__)
6#error "Do not include this file: Internal use only. Include <xtd/array> or <xtd/array.h> instead."
7#endif
8
10namespace xtd {
26 template<class type_t, class allocator_t = xtd::collections::generic::helpers::allocator<type_t>>
27 class basic_array : public xtd::array_abstract_object, public xtd::collections::generic::ilist<type_t>, public xtd::iequatable<basic_array<type_t, allocator_t >> {
28 class __comparer__ {
29 public:
30 __comparer__(const xtd::collections::generic::icomparer<type_t>* comparer) : comparer_(comparer) { }
31 __comparer__(const __comparer__&) = default;
32 __comparer__(__comparer__&&) = default;
33 __comparer__& operator=(const __comparer__ & comparer) = default;
34 __comparer__& operator=(__comparer__&&) = default;
35
36 bool operator()(const type_t& e1, const type_t& e2) const noexcept {return comparer_ && comparer_->compare(e1, e2) < 0;}
37
38 private:
40 };
41
42 class comparison_comparer {
43 template<class comparison_t>
44 using comparison = std::function<int32(comparison_t x, comparison_t y)>;
45
46 public:
47 comparison_comparer() = default;
48 comparison_comparer(comparison<const type_t&> c) : comparer(c) {}
49
50 comparison_comparer(const comparison_comparer & mc) = default;
51 comparison_comparer& operator=(const comparison_comparer & mc) = default;
52
53 bool operator()(const type_t& e1, const type_t& e2) const {return comparer(e1, e2) < 0;}
54
55 private:
57 };
58
59 public:
61
64 using value_type = type_t;
68 using base_type = typename __xtd_raw_array_data__<value_type, allocator_type>::base_type;
80 using const_pointer = const value_type*;
86 using reverse_iterator = typename __xtd_raw_array_data__<value_type>::reverse_iterator;
88 using const_reverse_iterator = typename __xtd_raw_array_data__<value_type>::const_reverse_iterator;
90
92
94 basic_array(const basic_array & array) { if (array.data_) *data_ = *array.data_;}
95 basic_array(basic_array&& array) = default;
97
99
104 virtual reference back() {return at(length() - 1);}
108 virtual const_reference back() const {return at(length() - 1);}
109
116
120
124
129 size_type count() const noexcept override {return data_->items.size();}
130
134 virtual const_reverse_iterator crbegin() const noexcept {return data_->items.crbegin();}
135
139 virtual const_reverse_iterator crend() const noexcept {return data_->items.crend();}
140
144 virtual pointer data() noexcept {return (pointer)data_->items.data();}
148 virtual const_pointer data() const noexcept {return (pointer)data_->items.data();}
149
156
160 virtual reference front() {return at(0);}
164 virtual const_reference front() const {return at(0);}
165
166 bool is_fixed_size() const noexcept override {return true;}
167 bool is_read_only() const noexcept override {return false;}
168 bool is_synchronized() const noexcept override {return false;}
169
172 virtual const base_type & items() const noexcept {return data_->items;}
175 virtual base_type & items() noexcept {return data_->items;}
176
183 virtual size_type length() const noexcept {return data_->items.size();}
187 virtual xtd::int64 long_length() {return static_cast<xtd::int64>(length());}
188
191 virtual size_type max_size() const noexcept {return data_->items.max_size();}
192
198 virtual size_type rank() const noexcept {return 1;}
199
203 virtual reverse_iterator rbegin() noexcept {return data_->items.rbegin();}
207 virtual const_reverse_iterator rbegin() const noexcept {return data_->items.rbegin();}
208
212 virtual reverse_iterator rend() noexcept {return data_->items.rend();}
216 virtual const_reverse_iterator rend() const noexcept {return data_->items.rend();}
217
218 const xtd::object & sync_root() const noexcept override {return data_->sync_root;}
220
222
228 virtual reference at(size_type index) {
230 return (reference)data_->items.at(index);
231 }
232
236 virtual const_reference at(size_type index) const {
238 return (reference)data_->items.at(index);
239 }
240
243 bool contains(const type_t& value) const noexcept override {
244 for (const auto& item : data_->items)
245 if (xtd::collections::generic::helpers::equator<type_t> {}(reinterpret_cast<const type_t&>(item), value)) return true;
246 return false;
247 }
248
249 void copy_to(xtd::array<type_t>& array, size_type index) const override {
253 for (auto increment = size_type {0}; increment < length(); ++increment)
254 array[index + increment] = at(increment);
255 }
256
262 void copy_to(xtd::array<type_t>& array, xtd::int64 index) const {copy_to(array, static_cast<xtd::size>(index));}
263
264 bool equals(const object & obj) const noexcept override {return dynamic_cast<const basic_array<value_type>*>(&obj) && equals(static_cast<const basic_array<value_type>&>(obj));}
265 bool equals(const basic_array & rhs) const noexcept override {
266 if (count() != rhs.count()) return false;
267 for (size_type i = 0; i < count(); i++)
268 if (!xtd::collections::generic::helpers::equator<type_t> {}(data_->items.at(i), rhs.data_->items.at(i))) return false;
269 return data_->lower_bound == rhs.data_->lower_bound && data_->upper_bound == rhs.data_->upper_bound;
270 }
271
274 virtual void fill(const value_type & value) noexcept {
275 for (auto& item : data_->items)
276 item = value;
277 }
278
279 xtd::collections::generic::enumerator<value_type> get_enumerator() const noexcept override {
280 struct basic_array_enumerator : public xtd::collections::generic::ienumerator < value_type > {
281 public:
282 explicit basic_array_enumerator(const basic_array & items, size_type version) : items_(items), version_(version) {}
283
284 const value_type & current() const override {
285 if (version_ != items_.data_->items.version()) xtd::helpers::throw_helper::throws(xtd::helpers::exception_case::invalid_operation, "Collection was modified; enumeration operation may not execute.");
286 if (index_ < items_.count()) return items_[index_];
287 return default_value_;
288 }
289
290 bool move_next() override {
291 if (version_ != items_.data_->items.version()) xtd::helpers::throw_helper::throws(xtd::helpers::exception_case::invalid_operation, "Collection was modified; enumeration operation may not execute.");
292 return ++index_ < items_.count();
293 }
294
295 void reset() override {
296 version_ = items_.data_->items.version();
297 index_ = basic_array::npos;
298 }
299
300protected:
301 const basic_array& items_;
302 size_type index_ = basic_array::npos;
303 size_type version_ = 0;
304 value_type default_value_;
305 };
306 return {new_ptr < basic_array_enumerator > (*this, data_->items.version())};
307 }
308
316 constexpr size_type get_length(size_type dimension) const {return get_upper_bound(dimension) + 1;}
317
325 constexpr xtd::int64 get_long_length(size_type dimension) const {return static_cast < xtd::int64 > (get_upper_bound(dimension) + 1);}
326
334 constexpr size_type get_lower_bound(size_type dimension) const {
336 return data_->lower_bound[dimension];
337 }
338
346 constexpr size_type get_upper_bound(size_type dimension) const {
348 return data_->upper_bound[dimension];
349 }
350
355 const value_type & get_value(const xtd::array < size_type > & indexes) const;
356
360 size_type index_of(const type_t& value) const noexcept override {return index_of(*this, value, 0, count());}
361
367 void resize(size_type new_size) {resize(new_size, value_type {});}
368
375 void resize(size_type new_size, value_type value) {
376 if (new_size == length()) return;
378 data_->items.resize(new_size, value);
379 data_->upper_bound[0] = new_size - 1;
380 }
381
386 void set_value(const type_t& value, const xtd::array < size_type > & indexes) {operator()(indexes) = value;}
387
390 virtual void swap(basic_array & other) noexcept {
391 data_->items.swap(other.data_->items);
392 }
393
394 xtd::string to_string() const noexcept override;
396
398
407 static size_type index_of(const basic_array & array, const value_type & value) noexcept {return index_of(array, value, 0, array.length());}
408
418 static size_type index_of(const basic_array & array, const value_type & value, size_type index) {return index_of(array, value, index, array.length() - index);}
419
430 static size_type index_of(const basic_array & array, const value_type & value, size_type index, size_type count) {
431 if (index > array.length() || index + count > array.length()) xtd::helpers::throw_helper::throws(xtd::helpers::exception_case::argument_out_of_range);
432
433 if (array.size() == 0) return npos;
434 for (auto increment = size_type {0}; increment < count; ++increment) {
435 if (xtd::collections::generic::helpers::equator < type_t > {}(array[index + increment], value))
436 return index + increment;
437 }
438 return npos;
439 }
440
444 static void reverse(basic_array & array) noexcept {reverse(array, 0, array.count());}
451 static void reverse(basic_array & array, size_type index, size_type count) {
452 if (index > array.size() || index + count > array.size()) xtd::helpers::throw_helper::throws(xtd::helpers::exception_case::argument_out_of_range);
453 if (count == 0) return;
454 array.data_->items.increment_version();
455 std::reverse(array.data_->items.begin() + index, array.data_->items.begin() + index + count);
456 }
457
468
474 basic_array < type_t > & sort(comparison_comparer comparison) {
475 data_->items.increment_version();
476 std::sort(data_->items.begin(), data_->items.end(), comparison_comparer {comparison});
477 return self_;
478 }
479
486 basic_array < type_t > & sort(const xtd::collections::generic::icomparer < type_t > & comparer) {
487 return sort(0, count(), comparer);
488 }
489
498 basic_array < type_t > & sort(xtd::size index, xtd::size count, const xtd::collections::generic::icomparer < type_t > & comparer) {
500 data_->items.increment_version();
501 std::sort(data_->items.begin(), data_->items.end(), __comparer__ {comparer});
502 return self_;
503 }
504
505
507
512 basic_array& operator =(const basic_array & other) {
513 *data_ = *other.data_;
514 return *this;
515 }
516
519 basic_array& operator =(basic_array&& other) noexcept = default;
523 basic_array& operator =(std::initializer_list < type_t > & items) {
524 data_->items = items;
525 data_->upper_bound[0] = data_->items.size() - 1;
526 return *this;
527 }
528
533 const_reference operator [](size_type index) const override {return at(index);}
538 reference operator [](size_type index) override {return at(index);}
539
542 operator const base_type & () const noexcept {return data_->items;}
545 operator base_type & () noexcept {return data_->items;}
546
554 type_t& operator()(const xtd::array < size_type > & indexes);
555
563 const type_t& operator()(const xtd::array < size_type > & indexes) const;
565
566 private:
567 template < class type_array_t, size_type rank_array_t, class allocator_array_t >
568 friend class array;
569
570 basic_array() = default;
571 basic_array(const array < size_type, 1 > & lengths);
572 basic_array(const array < size_type, 1 > & lengths, const value_type & value);
573
574 basic_array(const_pointer array, size_type length) {
576 data_->items = base_type {array, array + length};
577 data_->upper_bound[0] = data_->items.size() - 1;
578 }
579
580 basic_array(const xtd::collections::generic::ienumerable < type_t > & enumerable) {
581 for (const auto& value : enumerable)
582 data_->items.push_back(value);
583 data_->upper_bound[0] = data_->items.size() - 1;
584 }
585
586 basic_array(const std::vector < type_t > & array) {
587 data_->items = array;
588 data_->upper_bound[0] = data_->items.size() - 1;
589 }
590
591 basic_array(std::vector < type_t > && array) {
592 data_->items = std::move(array);
593 data_->upper_bound[0] = data_->items.size() - 1;
594 }
595
596 basic_array(std::initializer_list < type_t > il) {
597 data_->items.assign(il.begin(), il.end());
598 data_->upper_bound[0] = data_->items.size() - 1;
599 }
600
601 basic_array(std::initializer_list < std::initializer_list < type_t>> il) {
602 for (const std::initializer_list < type_t > & il1 : il)
603 data_->items.insert(data_->items.end(), il1.begin(), il1.end());
604 data_->upper_bound[0] = il.size() - 1;
605 data_->lower_bound.push_back(0);
606 data_->upper_bound.push_back((*il.begin()).size() - 1);
607 }
608
609 basic_array(std::initializer_list < std::initializer_list < std::initializer_list<type_t>>> il) {
610 for (const std::initializer_list < std::initializer_list < type_t>>& il1 : il)
611 for (const std::initializer_list < type_t > & il2 : il1)
612 data_->items.insert(data_->items.end(), il2.begin(), il2.end());
613 data_->upper_bound[0] = il.size() - 1;
614 data_->lower_bound.push_back(0);
615 data_->upper_bound.push_back((*il.begin()).size() - 1);
616 data_->lower_bound.push_back(0);
617 data_->upper_bound.push_back((*(*il.begin()).begin()).size() - 1);
618 }
619
620 template < class input_iterator_t >
621 basic_array(input_iterator_t first, input_iterator_t last) {
622 data_->items.assign(first, last);
623 data_->upper_bound.push_back(data_->items.size() - 1);
624 }
625
626 void add(const type_t& item) override {}
627 void clear() override {}
628 void insert(size_type index, const type_t& value) override {}
629 bool remove(const type_t& item) override {return false;}
630 void remove_at(size_type index) override {}
631
632 typename __xtd_raw_array_data__ < value_type >::iterator to_base_type_iterator(iterator value) noexcept {
633 if (value == begin()) return data_->items.begin();
634 if (value == end()) return data_->items.end();
635 return data_->items.begin() + (value - begin());
636 }
637
638 iterator to_iterator(typename __xtd_raw_array_data__ < value_type >::iterator value) noexcept {
639 if (value == data_->items.begin()) return begin();
640 if (value == data_->items.end()) return end();
641 return begin() + (value - data_->items.begin());
642 }
643
644 struct array_data {
645 __xtd_raw_array_data__ < value_type > items;
646 std::vector < size_type > lower_bound {0};
647 std::vector < size_type > upper_bound {std::numeric_limits < size_type >::max()};
648 object sync_root;
649 };
650
652 };
653}
Abstract object that represent array.
Definition array_abstract_object.hpp:25
Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the ba...
Definition array.hpp:63
xtd::size rank() const noexcept override
Gets the rank (number of dimensions) of the array.
Definition array.hpp:92
Base object that represent array.
Definition basic_array.hpp:27
const value_type & const_reference
Represents the const reference of array value type.
Definition basic_array.hpp:76
constexpr xtd::int64 get_long_length(size_type dimension) const
Gets a 64-bit integer that represents the total number of elements in all the dimensions of the array...
Definition basic_array.hpp:325
xtd::collections::generic::helpers::allocator< value_type > allocator_type
Represents the array allocator type.
Definition basic_array.hpp:66
virtual const_reverse_iterator rbegin() const noexcept
Returns a reverse iterator to the first element of the reversed vector. It corresponds to the last el...
Definition basic_array.hpp:207
virtual size_type rank() const noexcept
Gets the rank (number of dimensions) of the array.
Definition basic_array.hpp:198
virtual const_pointer data() const noexcept
Returns pointer to the underlying array serving as element storage.
Definition basic_array.hpp:148
void set_value(const type_t &value, const xtd::array< size_type > &indexes)
Sets a value to the element at the specified position in the multidimensional array.
Definition basic_array.hpp:386
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 ...
const_iterator cend() const noexcept override
Returns an iterator to the element following the last element of the enumerable.
Definition basic_array.hpp:123
typename xtd::collections::generic::ienumerable< type_t >::const_iterator const_iterator
Represents the const iterator of array value type.
Definition basic_array.hpp:84
typename __xtd_raw_array_data__< value_type >::const_reverse_iterator const_reverse_iterator
Represents the const reverse iterator of array value type.
Definition basic_array.hpp:88
basic_array< type_t > & sort(comparison_comparer comparison)
Sorts the elements in the entire xtd::collections::generic::list <type_t> using the specified xtd::co...
Definition basic_array.hpp:474
xtd::ptrdiff difference_type
Represents the array difference type (usually xtd::ptrdiff).
Definition basic_array.hpp:72
virtual reference front()
Returns a reference to the first element in the container.
Definition basic_array.hpp:160
size_type count() const noexcept override
Gets the number of elements contained in the xtd::array <type_t>.
Definition basic_array.hpp:129
virtual const_reverse_iterator rend() const noexcept
Returns a reverse iterator to the element following the last element of the reversed vector....
Definition basic_array.hpp:216
virtual reference at(size_type index)
Returns a reference to the element at specified location pos, with bounds checking.
Definition basic_array.hpp:228
bool equals(const object &obj) const noexcept override
Determines whether the specified object is equal to the current object.
Definition basic_array.hpp:264
basic_array< type_t > & sort(const xtd::collections::generic::icomparer< type_t > &comparer)
Sorts the elements in the entire xtd::collections::generic::list <type_t> using the specified compare...
Definition basic_array.hpp:486
constexpr size_type get_length(size_type dimension) const
Gets the total number of elements in all the dimensions of the array.
Definition basic_array.hpp:316
virtual xtd::int64 long_length()
Gets a 64-bit integer that represents the total number of elements in all the dimensions of the array...
Definition basic_array.hpp:187
const value_type * const_pointer
Represents the const pointer of array value type.
Definition basic_array.hpp:80
virtual const_reference back() const
Returns a reference to the last element in the container.
Definition basic_array.hpp:108
bool contains(const type_t &value) const noexcept override
Determines whether an element is in the array.
Definition basic_array.hpp:243
static size_type index_of(const basic_array &array, const value_type &value) noexcept
Determines the index of a specific item in the array specified.
Definition basic_array.hpp:407
value_type * pointer
Represents the pointer of array value type.
Definition basic_array.hpp:78
virtual pointer data() noexcept
Returns pointer to the underlying array serving as element storage.
Definition basic_array.hpp:144
value_type & reference
Represents the reference of array value type.
Definition basic_array.hpp:74
size_type index_of(const type_t &value) const noexcept override
Determines the index of a specific item in the xtd::array <type_t>.
Definition basic_array.hpp:360
const_iterator end() const noexcept override
Returns an iterator to the element following the last element of the enumerable.
Definition basic_array.hpp:152
constexpr size_type get_lower_bound(size_type dimension) const
Gets the lower bound of the specified dimension in the array.
Definition basic_array.hpp:334
virtual size_type max_size() const noexcept
Returns the maximum number of elements the container is able to hold due to system or library impleme...
Definition basic_array.hpp:191
void resize(size_type new_size, value_type value)
Resizes the container to contain count elements, does nothing if count == length()....
Definition basic_array.hpp:375
iterator begin() noexcept override
Returns an iterator to the first element of the enumerable.
Definition basic_array.hpp:115
const_iterator begin() const noexcept override
Returns an iterator to the first element of the enumerable.
Definition basic_array.hpp:112
void copy_to(xtd::array< type_t > &array, xtd::int64 index) const
Copies all the elements of the current one-dimensional array to the specified one-dimensional array s...
Definition basic_array.hpp:262
type_t value_type
Represents the array value type.
Definition basic_array.hpp:64
virtual void fill(const value_type &value) noexcept
Assigns the value to all elements in the container.
Definition basic_array.hpp:274
typename __xtd_raw_array_data__< value_type >::reverse_iterator reverse_iterator
Represents the reverse iterator of array value type.
Definition basic_array.hpp:86
basic_array & operator=(const basic_array &other)
Copy assignment operator. Replaces the contents with a copy of the contents of other.
Definition basic_array.hpp:512
virtual reverse_iterator rbegin() noexcept
Returns a reverse iterator to the first element of the reversed vector. It corresponds to the last el...
Definition basic_array.hpp:203
iterator end() noexcept override
Returns an iterator to the element following the last element of the enumerable.
Definition basic_array.hpp:155
virtual const_reference at(size_type index) const
Returns a reference to the element at specified location pos, with bounds checking.
Definition basic_array.hpp:236
virtual size_type length() const noexcept
Gets a size that represents the total number of elements in all the dimensions of the array.
Definition basic_array.hpp:183
const type_t & operator()(const xtd::array< size_type > &indexes) const
Gets the value at the specified position in the multidimensional array. The indexes are specified as ...
virtual reverse_iterator rend() noexcept
Returns a reverse iterator to the element following the last element of the reversed vector....
Definition basic_array.hpp:212
virtual const base_type & items() const noexcept
Returns the underlying base type items.
Definition basic_array.hpp:172
constexpr size_type get_upper_bound(size_type dimension) const
Gets the upper bound of the specified dimension in the array.
Definition basic_array.hpp:346
basic_array< type_t > & sort()
Sorts the elements in the entire xtd::collections::generic::list <type_t> using the default comparer.
Definition basic_array.hpp:467
basic_array< type_t > & sort(xtd::size index, xtd::size count, const xtd::collections::generic::icomparer< type_t > &comparer)
Sorts the elements in a range of elements in xtd::collections::generic::list <type_t> using the speci...
Definition basic_array.hpp:498
virtual const_reverse_iterator crend() const noexcept
Returns a reverse iterator to the element following the last element of the reversed vector....
Definition basic_array.hpp:139
virtual void swap(basic_array &other) noexcept
Exchanges the contents and capacity of the container with those of other. Does not invoke any move,...
Definition basic_array.hpp:390
xtd::string to_string() const noexcept override
Returns a xtd::string that represents the current object.
typename xtd::collections::generic::ienumerable< type_t >::iterator iterator
Represents the iterator of array value type.
Definition basic_array.hpp:82
const_reference operator[](size_type index) const override
Returns a reference to the element at specified location index.
Definition basic_array.hpp:533
virtual const_reference front() const
Returns a reference to the first element in the container.
Definition basic_array.hpp:164
static void reverse(basic_array &array) noexcept
Reverses the order of the elements in the entire xtd::basic_array.
Definition basic_array.hpp:444
static size_type index_of(const basic_array &array, const value_type &value, size_type index, size_type count)
Determines the index of a specific item in the array specified.
Definition basic_array.hpp:430
static size_type index_of(const basic_array &array, const value_type &value, size_type index)
Determines the index of a specific item in the array specified.
Definition basic_array.hpp:418
virtual reference back()
Returns a reference to the last element in the container.
Definition basic_array.hpp:104
const_iterator cbegin() const noexcept override
Returns an iterator to the first element of the enumerable.
Definition basic_array.hpp:119
virtual base_type & items() noexcept
Returns the underlying base type items.
Definition basic_array.hpp:175
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 ...
static void reverse(basic_array &array, size_type index, size_type count)
Reverses the order of the elements in the specified range.
Definition basic_array.hpp:451
typename __xtd_raw_array_data__< value_type, allocator_type >::base_type base_type
Represents the array base type.
Definition basic_array.hpp:68
virtual const_reverse_iterator crbegin() const noexcept
Returns a reverse iterator to the first element of the reversed vector. It corresponds to the last el...
Definition basic_array.hpp:134
xtd::size size_type
Represents the array size type (usually xtd::size).
Definition basic_array.hpp:70
static const comparer< xtd::any_object > default_comparer
Definition comparer.hpp:50
virtual const_iterator cbegin() const
Returns an iterator to the first element of the enumerable.
Definition enumerable_iterators.hpp:148
virtual const_iterator begin() const
Returns an iterator to the first element of the enumerable.
Definition enumerable_iterators.hpp:141
virtual const_iterator cend() const
Returns an iterator to the element following the last element of the enumerable.
Definition enumerable_iterators.hpp:152
virtual const_iterator end() const
Returns an iterator to the element following the last element of the enumerable.
Definition enumerable_iterators.hpp:156
Provides a set of static methods for querying objects that implement ienumerable <type_t>.
Definition enumerable.hpp:32
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
typename xtd::collections::generic::extensions::enumerable_iterators< xtd::any_object, xtd::collections::generic::ienumerable< xtd::any_object > >::const_iterator const_iterator
Definition ienumerable.hpp:50
typename xtd::collections::generic::extensions::enumerable_iterators< xtd::any_object, xtd::collections::generic::ienumerable< xtd::any_object > >::iterator iterator
Definition ienumerable.hpp:48
Supports a simple iteration over a generic collection.
Definition ienumerator.hpp:58
static void throws(xtd::helpers::exception_case exception_case, const source_location &location=source_location::current())
Throws an exption with specified exception case.
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition iequatable.hpp:22
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.hpp:44
Represents the version number of an assembly, operating system, or the xtd. This class cannot be inhe...
Definition version.hpp:114
xtd::delegate< int32(type_t x, type_t y)> comparison
Represents the method that compares two objects of the same type.
Definition comparison.hpp:33
std::allocator< type_t > allocator
Represent an allocator alias.
Definition allocator.hpp:38
@ argument
The argument is not valid.
Definition exception_case.hpp:31
@ index_out_of_range
The index is out of range.
Definition exception_case.hpp:59
@ out_of_memory
Out of memory.
Definition exception_case.hpp:85
@ rank
The rank is not valid.
Definition exception_case.hpp:91
@ argument_null
The argument is null.
Definition exception_case.hpp:33
@ argument_out_of_range
The argument is out of range.
Definition exception_case.hpp:35
@ invalid_operation
The operation is not valid.
Definition exception_case.hpp:63
#define self_
The self_ expression is a reference value expression whose value is the reference of the implicit obj...
Definition self.hpp:20
xtd::basic_string< char > string
Represents text as a sequence of UTF-8 code units.
Definition __string_definitions.hpp:43
constexpr xtd::size npos
Represents a value that is not a valid position in a collection.
Definition npos.hpp:26
std::int64_t int64
Represents a 64-bit signed integer.
Definition int64.hpp:23
size_t size
Represents a size of any object in bytes.
Definition size.hpp:23
null_ptr null
Represents a null pointer value.
std::int32_t int32
Represents a 32-bit signed integer.
Definition int32.hpp:23
xtd::sptr< type_t > ptr
The xtd::ptr object is a shared pointer.
Definition ptr.hpp:27
std::ptrdiff_t ptrdiff
Represent the signed integer type of the result of subtracting two pointers.
Definition ptrdiff.hpp:23
ptr< type_t > new_ptr(args_t &&... args)
The xtd::new_ptr operator creates a xtd::ptr object.
Definition new_ptr.hpp:24
@ other
The operating system is other.
Definition platform_id.hpp:58
@ add
The Add key.
Definition console_key.hpp:170
@ y
The Y key.
Definition console_key.hpp:136
@ c
The C key.
Definition console_key.hpp:92
@ i
The I key.
Definition console_key.hpp:104
@ x
The X key.
Definition console_key.hpp:134
@ insert
The INS (INSERT) key.
Definition console_key.hpp:62
size_type
Specifies how rows or columns of user interface (UI) elements should be sized relative to their conta...
Definition size_type.hpp:22
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8
void copy_to(span< type_t, length > &destination) const
Copies the contents of this xtd::read_only_span <type_t> into a destination xtd:span <type_t>.
Definition read_only_span.hpp:264
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
Supports a simple iteration over a generic collection.
Definition enumerator.hpp:38
Implements a function object for performing comparisons. Unless specialised, invokes operator== on ty...
Definition equator.hpp:38