Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: DeepCover Embedded Security in IoT MaximInterface MAXREFDES155#
Diff: Utilities/array.hpp
- Revision:
- 6:471901a04573
- Parent:
- 5:a8c83a2e6fa4
diff -r a8c83a2e6fa4 -r 471901a04573 Utilities/array.hpp
--- a/Utilities/array.hpp Wed Jan 23 13:11:04 2019 -0600
+++ b/Utilities/array.hpp Mon Mar 04 08:10:00 2019 -0600
@@ -57,6 +57,7 @@
/// @name Element access
/// @{
+
reference operator[](size_type pos) {
return const_cast<reference>(
static_cast<const array &>(*this).operator[](pos));
@@ -81,10 +82,12 @@
}
const_pointer data() const { return _buffer; }
+
/// @}
/// @name Iterators
- /// @{
+ /// @{
+
iterator begin() {
return const_cast<iterator>(static_cast<const array &>(*this).cbegin());
}
@@ -116,10 +119,12 @@
}
const_reverse_iterator crend() const { return rend(); }
+
/// @}
/// @name Capacity
/// @{
+
static bool empty() { return size() == 0; }
static size_type size() { return N; }
@@ -128,17 +133,20 @@
/// Alternative to size() when a constant expression is required.
static const size_type csize = N;
+
/// @}
/// @name Operations
/// @{
+
void fill(const_reference value) { std::fill(begin(), end(), value); }
void swap(array & other) { std::swap_ranges(begin(), end(), other.begin()); }
+
/// @}
/// @private
- /// Implementation detail set public to allow aggregate initialization.
+ /// @note Implementation detail set public to allow aggregate initialization.
T _buffer[N];
};