22 #ifndef __utl_container_id_h__ 23 #define __utl_container_id_h__ 36 template <
typename _Tp,
size_t _Nm>
41 static constexpr _Tp&
Ref (
const type& t,
size_t n) noexcept {
42 return const_cast<_Tp&
> (t[n]);
45 static constexpr _Tp*
Ptr(
const type& t) noexcept {
46 return const_cast<_Tp*
> (t);
50 template <
typename _Tp>
54 static constexpr _Tp&
Ref(
const type& t,
size_t n) noexcept {
55 return *
static_cast<_Tp*
>(
nullptr);
58 static constexpr _Tp*
Ptr(
const type& t) noexcept {
77 template <
typename _Tp,
size_t _Nm>
90 = std::reverse_iterator <const_iterator>;
102 std::swap_ranges (
begin(),
end(), other.begin());
125 constexpr
bool empty() const noexcept {
return size() == 0; }
152 static_assert ((n < _Nm),
"id_t::at: out of range");
159 constexpr
bool bit (uint8_t
bit)
const noexcept {
161 (
static_cast<value_type>(0x01) << ((
bit % (8*
sizeof(_Tp)))-1));
169 void bit (uint8_t
bit,
bool v) noexcept {
171 uint8_t den = 8*
sizeof(_Tp)/
sizeof(uint8_t);
185 return _Nm ? *(
end() - 1) : *
end();
200 template <
typename _Tp,
size_t _Nm>
205 template <
typename _Tp,
size_t _Nm>
207 return !(lhs == rhs);
210 template <
typename _Tp,
size_t _Nm>
213 return std::lexicographical_compare(lhs.rbegin(), lhs.rend(), rhs.rbegin(), rhs.rend());
216 template <
typename _Tp,
size_t _Nm>
221 template <
typename _Tp,
size_t _Nm>
226 template <
typename _Tp,
size_t _Nm>
bool operator==(const array< _Tp, _Nm > &lhs, const array< _Tp, _Nm > &rhs)
reference back() noexcept
const value_type & const_reference
const_reverse_iterator rbegin() const noexcept
static constexpr _Tp & Ref(const type &t, size_t n) noexcept
static constexpr _Tp * Ptr(const type &t) noexcept
const_iterator begin() const noexcept
reference front() noexcept
constexpr const_reference back() const noexcept
void fill(const value_type &v)
std::reverse_iterator< const_iterator > const_reverse_iterator
const_iterator cbegin() const noexcept
const value_type * const_pointer
void bit(uint8_t bit, bool v) noexcept
const_iterator cend() const noexcept
id container traits helper
const_reverse_iterator crend() const noexcept
std::ptrdiff_t difference_type
const_reverse_iterator rend() const noexcept
bool operator>=(const array< _Tp, _Nm > &lhs, const array< _Tp, _Nm > &rhs)
STL's core language concepts.
constexpr const_reference front() const noexcept
reverse_iterator rend() noexcept
constexpr size_type max_size() const noexcept
bool operator>(const array< _Tp, _Nm > &lhs, const array< _Tp, _Nm > &rhs)
const_iterator end() const noexcept
const value_type * const_iterator
void swap(id_t &other) noexcept
A standard container for storing IDs as a fixed size sequence of bytes. This type is based on etl::ar...
std::reverse_iterator< iterator > reverse_iterator
reverse_iterator rbegin() noexcept
const_reverse_iterator crbegin() const noexcept
constexpr bool empty() const noexcept
reference at(size_type n) noexcept
bool operator!=(const array< _Tp, _Nm > &lhs, const array< _Tp, _Nm > &rhs)
constexpr const_reference at(size_type n) const noexcept
Compile time boundary check dereference operator.
const_pointer data() const noexcept
reference operator[](size_type n) noexcept
Operator [].
iterator begin() noexcept
static constexpr _Tp * Ptr(const type &t) noexcept
Implementation detail main forward header.
static constexpr _Tp & Ref(const type &t, size_t n) noexcept
constexpr size_type size() const noexcept
constexpr bool bit(uint8_t bit) const noexcept