62 template<
typename T, bsl::u
intmax N>
65 static_assert(N != 0,
"arrays of size 0 are not supported");
154 return *this->
at_if(0U);
167 return *this->
at_if(0U);
180 return this->
at_if(0U);
193 return this->
at_if(0U);
206 return *this->
at_if(N - 1U);
219 return *this->
at_if(N - 1U);
232 return this->
at_if(N - 1U);
245 return this->
at_if(N - 1U);
480 size_type const ai{(i >= N) ? N : (i + 1U)};
501 size_type const ai{(i >= N) ? N : (i + 1U)};
522 size_type const ai{(i >= N) ? N : (i + 1U)};
592 [[nodiscard]]
static constexpr
bool 636 return N *
sizeof(T);
654 template<
typename T, bsl::u
intmax N>
663 if (*lhs.at_if(i) != *rhs.at_if(i)) {
685 template<
typename T, bsl::u
intmax N>
689 return !(lhs == rhs);
693 template<
typename T,
typename... U>
Provides a safe encapsulation for a C-style array, minicing the std::array APIs. This container is an...
Definition: array.hpp:63
T value_type
alias for: T
Definition: array.hpp:72
constexpr iterator_type end() noexcept
Returns an iterator to one past the last element of the array. If you attempt to access this iterator...
Definition: array.hpp:367
reverse_iterator< iterator_type > reverse_iterator_type
alias for: reverse_iterator<iterator>
Definition: array.hpp:90
If the provided type is a fundamental type, provides the member constant value equal to true....
Definition: is_fundamental.hpp:76
reverse_iterator< const_iterator_type > const_reverse_iterator_type
alias for: reverse_iterator<const_iterator>
Definition: array.hpp:92
bsl::uintmax difference_type
alias for: bsl::uintmax
Definition: array.hpp:76
constexpr bool operator!=(bsl::array< T, N > const &lhs, bsl::array< T, N > const &rhs) noexcept
Returns false if two arrays contain the same contents. Returns true otherwise.
Definition: array.hpp:687
constexpr pointer_type data() noexcept
Returns a pointer to the array being encapsulated.
Definition: array.hpp:256
constexpr const_iterator_type iter(size_type const i) const noexcept
Returns an iterator to the element "i" in the array.
Definition: array.hpp:336
constexpr const_reverse_iterator_type criter(size_type const i) const noexcept
Returns a reverse iterator element "i" in the array. When accessing the iterator, the iterator will a...
Definition: array.hpp:520
constexpr reverse_iterator_type riter(size_type const i) noexcept
Returns a reverse iterator element "i" in the array. When accessing the iterator, the iterator will a...
Definition: array.hpp:478
static constexpr bool empty() noexcept
Since arrays of size 0 are not allowed, always returns false.
Definition: array.hpp:593
constexpr iterator_type iter(size_type const i) noexcept
Returns an iterator to the element "i" in the array.
Definition: array.hpp:322
constexpr const_reverse_iterator_type crend() const noexcept
Returns a reverse iterator first element of the array. When accessing the iterator,...
Definition: array.hpp:578
constexpr pointer_type back_if() noexcept
Returns a pointer to the last element in the array.
Definition: array.hpp:230
static constexpr size_type size() noexcept
Returns the number of elements in the array being encapsulated.
Definition: array.hpp:608
T m_data[N]
stores the array being wrapped
Definition: array.hpp:65
constexpr const_reference_type back() const noexcept
Returns a reference to the last element in the array.
Definition: array.hpp:217
constexpr const_reference_type front() const noexcept
Returns a reference to the first element in the array.
Definition: array.hpp:165
constexpr const_iterator_type cend() const noexcept
Returns an iterator to one past the last element of the array. If you attempt to access this iterator...
Definition: array.hpp:401
constexpr pointer_type at_if(size_type const index) noexcept
Returns a pointer to the instance of T stored at index "index". If the index is out of bounds,...
Definition: array.hpp:113
static constexpr size_type max_size() noexcept
Returns the max number of elements the BSL supports.
Definition: array.hpp:621
constexpr bool operator==(bsl::array< T, N > const &lhs, bsl::array< T, N > const &rhs) noexcept
Returns true if two arrays contain the same contents. Returns false otherwise.
Definition: array.hpp:656
constexpr const_pointer_type front_if() const noexcept
Returns a pointer to the first element in the array.
Definition: array.hpp:191
constexpr const_pointer_type data() const noexcept
Returns a pointer to the array being encapsulated.
Definition: array.hpp:269
constexpr const_pointer_type at_if(size_type const index) const noexcept
Returns a pointer to the instance of T stored at index "index". If the index is out of bounds,...
Definition: array.hpp:135
T const & const_reference_type
alias for: T const &
Definition: array.hpp:80
static constexpr size_type size_bytes() noexcept
Returns size() * sizeof(T)
Definition: array.hpp:634
constexpr reference_type back() noexcept
Returns a reference to the last element in the array.
Definition: array.hpp:204
constexpr reverse_iterator_type rend() noexcept
Returns a reverse iterator first element of the array. When accessing the iterator,...
Definition: array.hpp:540
constexpr const_iterator_type cbegin() const noexcept
Returns an iterator to the first element of the array.
Definition: array.hpp:308
constexpr const_iterator_type end() const noexcept
Returns an iterator to one past the last element of the array. If you attempt to access this iterator...
Definition: array.hpp:384
constexpr const_iterator_type begin() const noexcept
Returns an iterator to the first element of the array.
Definition: array.hpp:295
T * pointer_type
alias for: T *
Definition: array.hpp:82
static constexpr T max() noexcept
Returns the max value of T.
Definition: numeric_limits.hpp:154
constexpr const_iterator_type citer(size_type const i) const noexcept
Returns an iterator to the element "i" in the array.
Definition: array.hpp:350
constexpr reverse_iterator_type rbegin() noexcept
Returns a reverse iterator to one past the last element of the array. When accessing the iterator,...
Definition: array.hpp:420
Provides a reverse iterator as defined by the C++ specification, with the follwing differences:
Definition: reverse_iterator.hpp:78
constexpr const_reverse_iterator_type rend() const noexcept
Returns a reverse iterator first element of the array. When accessing the iterator,...
Definition: array.hpp:559
contiguous_iterator< T const > const_iterator_type
alias for: contiguous_iterator<T const>
Definition: array.hpp:88
contiguous_iterator< T > iterator_type
alias for: contiguous_iterator<T>
Definition: array.hpp:86
constexpr pointer_type front_if() noexcept
Returns a pointer to the first element in the array.
Definition: array.hpp:178
constexpr const_reverse_iterator_type rbegin() const noexcept
Returns a reverse iterator to one past the last element of the array. When accessing the iterator,...
Definition: array.hpp:439
constexpr iterator_type begin() noexcept
Returns an iterator to the first element of the array.
Definition: array.hpp:282
constexpr reference_type front() noexcept
Returns a reference to the first element in the array.
Definition: array.hpp:152
constexpr const_pointer_type back_if() const noexcept
Returns a pointer to the last element in the array.
Definition: array.hpp:243
constexpr bool is_constant_evaluated() noexcept
Detects whether the function call occurs within a constant-evaluated context. Returns true if the eva...
Definition: is_constant_evaluated.hpp:46
T const * const_pointer_type
alias for: T const *
Definition: array.hpp:84
constexpr const_reverse_iterator_type crbegin() const noexcept
Returns a reverse iterator to one past the last element of the array. When accessing the iterator,...
Definition: array.hpp:458
::uintmax_t uintmax
defines a unsigned integer with the maximum possible size
Definition: cstdint.hpp:97
bsl::uintmax size_type
alias for: bsl::uintmax
Definition: array.hpp:74
T & reference_type
alias for: T &
Definition: array.hpp:78
Provides a contiguous iterator as defined by the C++ specification, with the follwing differences:
Definition: contiguous_iterator.hpp:76
bsl::int32 builtin_memcmp(void const *const lhs, void const *const rhs, bsl::uintmax const count) noexcept
Same as std::memcmp with parameter checks. If lhs, rhs are a nullptr, or count is 0,...
Definition: cstring.hpp:108
constexpr const_reverse_iterator_type riter(size_type const i) const noexcept
Returns a reverse iterator element "i" in the array. When accessing the iterator, the iterator will a...
Definition: array.hpp:499