uTL
micro Template library
utl::array< _Tp, _Nm > Struct Template Reference

A standard container for storing a fixed size sequence of elements. More...

#include <array.h>

Public Types

using value_type = _Tp
 
using pointer = value_type *
 
using const_pointer = const value_type *
 
using reference = value_type &
 
using const_reference = const value_type &
 
using iterator = value_type *
 
using const_iterator = const value_type *
 
using size_type = size_t
 
using difference_type = ptrdiff_t
 
using reverse_iterator = std::reverse_iterator< iterator >
 
using const_reverse_iterator = std::reverse_iterator< const_iterator >
 
using array_t = array_traits< _Tp, _Nm >
 

Public Member Functions

void fill (const value_type &v)
 
void swap (array &other) noexcept
 
Iterators.
iterator begin () noexcept
 
const_iterator begin () const noexcept
 
iterator end () noexcept
 
const_iterator end () const noexcept
 
const_iterator cbegin () const noexcept
 
const_iterator cend () const noexcept
 
reverse_iterator rbegin () noexcept
 
reverse_iterator rend () noexcept
 
const_reverse_iterator rbegin () const noexcept
 
const_reverse_iterator rend () const noexcept
 
const_reverse_iterator crbegin () const noexcept
 
const_reverse_iterator crend () const noexcept
 
Capacity.
constexpr size_type size () const noexcept
 
constexpr size_type max_size () const noexcept
 
constexpr bool empty () const noexcept
 
Element access.
reference operator[] (size_type n) noexcept
 Operator []. More...
 
constexpr const_reference operator[] (size_type n) const noexcept
 Operator [] for const. More...
 
reference at (size_type n) noexcept
 
constexpr const_reference at (size_type n) const noexcept
 Compile time boundary check dereference operator. More...
 
reference front () noexcept
 
constexpr const_reference front () const noexcept
 
reference back () noexcept
 
constexpr const_reference back () const noexcept
 
pointer data () noexcept
 
const_pointer data () const noexcept
 

Public Attributes

array_t::type _data
 

Detailed Description

template<typename _Tp, size_t _Nm>
struct utl::array< _Tp, _Nm >

A standard container for storing a fixed size sequence of elements.

Meets the requirements of: container, reversible container, sequence. Sets support random access iterators.

Template Parameters
_Tptype of element. Required to be a complete type.
_NmNumber of elements.

Definition at line 77 of file array.h.

Member Typedef Documentation

◆ array_t

template<typename _Tp, size_t _Nm>
using utl::array< _Tp, _Nm >::array_t = array_traits<_Tp, _Nm>

Definition at line 93 of file array.h.

◆ const_iterator

template<typename _Tp, size_t _Nm>
using utl::array< _Tp, _Nm >::const_iterator = const value_type*

Definition at line 84 of file array.h.

◆ const_pointer

template<typename _Tp, size_t _Nm>
using utl::array< _Tp, _Nm >::const_pointer = const value_type*

Definition at line 80 of file array.h.

◆ const_reference

template<typename _Tp, size_t _Nm>
using utl::array< _Tp, _Nm >::const_reference = const value_type&

Definition at line 82 of file array.h.

◆ const_reverse_iterator

template<typename _Tp, size_t _Nm>
using utl::array< _Tp, _Nm >::const_reverse_iterator = std::reverse_iterator <const_iterator>

Definition at line 89 of file array.h.

◆ difference_type

template<typename _Tp, size_t _Nm>
using utl::array< _Tp, _Nm >::difference_type = ptrdiff_t

Definition at line 86 of file array.h.

◆ iterator

template<typename _Tp, size_t _Nm>
using utl::array< _Tp, _Nm >::iterator = value_type*

Definition at line 83 of file array.h.

◆ pointer

template<typename _Tp, size_t _Nm>
using utl::array< _Tp, _Nm >::pointer = value_type*

Definition at line 79 of file array.h.

◆ reference

template<typename _Tp, size_t _Nm>
using utl::array< _Tp, _Nm >::reference = value_type&

Definition at line 81 of file array.h.

◆ reverse_iterator

template<typename _Tp, size_t _Nm>
using utl::array< _Tp, _Nm >::reverse_iterator = std::reverse_iterator <iterator>

Definition at line 87 of file array.h.

◆ size_type

template<typename _Tp, size_t _Nm>
using utl::array< _Tp, _Nm >::size_type = size_t

Definition at line 85 of file array.h.

◆ value_type

template<typename _Tp, size_t _Nm>
using utl::array< _Tp, _Nm >::value_type = _Tp

Definition at line 78 of file array.h.

Member Function Documentation

◆ at() [1/2]

template<typename _Tp, size_t _Nm>
reference utl::array< _Tp, _Nm >::at ( size_type  n)
inlinenoexcept

Boundary check dereference operator. If out of bounds, abort (for now)

Definition at line 144 of file array.h.

◆ at() [2/2]

template<typename _Tp, size_t _Nm>
constexpr const_reference utl::array< _Tp, _Nm >::at ( size_type  n) const
inlinenoexcept

Compile time boundary check dereference operator.

Definition at line 151 of file array.h.

◆ back() [1/2]

template<typename _Tp, size_t _Nm>
reference utl::array< _Tp, _Nm >::back ( )
inlinenoexcept

Definition at line 164 of file array.h.

◆ back() [2/2]

template<typename _Tp, size_t _Nm>
constexpr const_reference utl::array< _Tp, _Nm >::back ( ) const
inlinenoexcept

Definition at line 167 of file array.h.

◆ begin() [1/2]

template<typename _Tp, size_t _Nm>
iterator utl::array< _Tp, _Nm >::begin ( )
inlinenoexcept

Definition at line 107 of file array.h.

◆ begin() [2/2]

template<typename _Tp, size_t _Nm>
const_iterator utl::array< _Tp, _Nm >::begin ( ) const
inlinenoexcept

Definition at line 108 of file array.h.

◆ cbegin()

template<typename _Tp, size_t _Nm>
const_iterator utl::array< _Tp, _Nm >::cbegin ( ) const
inlinenoexcept

Definition at line 111 of file array.h.

◆ cend()

template<typename _Tp, size_t _Nm>
const_iterator utl::array< _Tp, _Nm >::cend ( ) const
inlinenoexcept

Definition at line 112 of file array.h.

◆ crbegin()

template<typename _Tp, size_t _Nm>
const_reverse_iterator utl::array< _Tp, _Nm >::crbegin ( ) const
inlinenoexcept

Definition at line 118 of file array.h.

◆ crend()

template<typename _Tp, size_t _Nm>
const_reverse_iterator utl::array< _Tp, _Nm >::crend ( ) const
inlinenoexcept

Definition at line 119 of file array.h.

◆ data() [1/2]

template<typename _Tp, size_t _Nm>
pointer utl::array< _Tp, _Nm >::data ( )
inlinenoexcept

Definition at line 173 of file array.h.

◆ data() [2/2]

template<typename _Tp, size_t _Nm>
const_pointer utl::array< _Tp, _Nm >::data ( ) const
inlinenoexcept

Definition at line 174 of file array.h.

◆ empty()

template<typename _Tp, size_t _Nm>
constexpr bool utl::array< _Tp, _Nm >::empty ( ) const
inlinenoexcept

Definition at line 125 of file array.h.

◆ end() [1/2]

template<typename _Tp, size_t _Nm>
iterator utl::array< _Tp, _Nm >::end ( )
inlinenoexcept

Definition at line 109 of file array.h.

◆ end() [2/2]

template<typename _Tp, size_t _Nm>
const_iterator utl::array< _Tp, _Nm >::end ( ) const
inlinenoexcept

Definition at line 110 of file array.h.

◆ fill()

template<typename _Tp, size_t _Nm>
void utl::array< _Tp, _Nm >::fill ( const value_type v)
inline

Definition at line 99 of file array.h.

◆ front() [1/2]

template<typename _Tp, size_t _Nm>
reference utl::array< _Tp, _Nm >::front ( )
inlinenoexcept

Definition at line 156 of file array.h.

◆ front() [2/2]

template<typename _Tp, size_t _Nm>
constexpr const_reference utl::array< _Tp, _Nm >::front ( ) const
inlinenoexcept

Definition at line 159 of file array.h.

◆ max_size()

template<typename _Tp, size_t _Nm>
constexpr size_type utl::array< _Tp, _Nm >::max_size ( ) const
inlinenoexcept

Definition at line 124 of file array.h.

◆ operator[]() [1/2]

template<typename _Tp, size_t _Nm>
reference utl::array< _Tp, _Nm >::operator[] ( size_type  n)
inlinenoexcept

Operator [].

Definition at line 132 of file array.h.

◆ operator[]() [2/2]

template<typename _Tp, size_t _Nm>
constexpr const_reference utl::array< _Tp, _Nm >::operator[] ( size_type  n) const
inlinenoexcept

Operator [] for const.

Definition at line 136 of file array.h.

◆ rbegin() [1/2]

template<typename _Tp, size_t _Nm>
reverse_iterator utl::array< _Tp, _Nm >::rbegin ( )
inlinenoexcept

Definition at line 114 of file array.h.

◆ rbegin() [2/2]

template<typename _Tp, size_t _Nm>
const_reverse_iterator utl::array< _Tp, _Nm >::rbegin ( ) const
inlinenoexcept

Definition at line 116 of file array.h.

◆ rend() [1/2]

template<typename _Tp, size_t _Nm>
reverse_iterator utl::array< _Tp, _Nm >::rend ( )
inlinenoexcept

Definition at line 115 of file array.h.

◆ rend() [2/2]

template<typename _Tp, size_t _Nm>
const_reverse_iterator utl::array< _Tp, _Nm >::rend ( ) const
inlinenoexcept

Definition at line 117 of file array.h.

◆ size()

template<typename _Tp, size_t _Nm>
constexpr size_type utl::array< _Tp, _Nm >::size ( ) const
inlinenoexcept

Definition at line 123 of file array.h.

◆ swap()

template<typename _Tp, size_t _Nm>
void utl::array< _Tp, _Nm >::swap ( array< _Tp, _Nm > &  other)
inlinenoexcept

Definition at line 101 of file array.h.

Member Data Documentation

◆ _data

template<typename _Tp, size_t _Nm>
array_t::type utl::array< _Tp, _Nm >::_data

Definition at line 94 of file array.h.


The documentation for this struct was generated from the following file: