1#ifndef SBL_PRIMITIVES_CONTAINERS_FIXED_ARRAY_HPP_
2#define SBL_PRIMITIVES_CONTAINERS_FIXED_ARRAY_HPP_
29template<
typename T,
size_t N>
31 static_assert(N > 0,
"Array size must be greater than 0");
55 explicit Array(
const T& value) {
90 return (index < N) ? data_[index] : data_[0];
100 return (index < N) ? data_[index] : data_[0];
239 data_[i] = other.data_[i];
240 other.data_[i] = temp;
Fixed-size array container.
reference back()
Access last element.
iterator begin()
Get iterator to beginning.
const_iterator begin() const
Get iterator to beginning (const)
const_reference at(size_type index) const
Access element with bounds checking (const)
reference at(size_type index)
Access element with bounds checking.
pointer data()
Get pointer to underlying array.
constexpr size_type size() const
Get array size.
reference operator[](size_type index)
Access element at index.
void fill(const T &value)
Fill array with value.
void swap(Array &other)
Swap contents with another array.
constexpr bool empty() const
Check if array is empty.
const_reference operator[](size_type index) const
Access element at index (const)
constexpr size_type max_size() const
Get maximum size.
iterator end()
Get iterator to end.
const_reference back() const
Access last element (const)
const_iterator end() const
Get iterator to end (const)
Array()=default
Default constructor.
Array(const T &value)
Fill constructor.
const_reference front() const
Access first element (const)
const_pointer data() const
Get pointer to underlying array (const)
reference front()
Access first element.
const T & const_reference
Root namespace for all Sound Byte Libs functionality.