fennec
Loading...
Searching...
No Matches
fennec::array< ValueT, ElemV >

Data Structure that defines a compile-time allocated array. More...

#include <array.h>

Detailed Description

template<typename ValueT, size_t ElemV>
struct fennec::array< ValueT, ElemV >
Property Value
stable
dynamic
homogenous
distinct
ordered
space \(O(N)\)
linear
access \(O(1)\)
find \(O(N)\)
insertion
deletion
Template Parameters
ValueTvalue type
ElemVnumber of elements

Public Types

using value_t = ValueT
 Alias for ValueT
 

Public Member Functions

Properties
constexpr size_t size () const
 returns the number of elements in the array
 
constexpr bool_t empty () const
 returns true when the array is empty
 
Element Access
constexpr value_toperator[] (size_t i)
 
constexpr const value_toperator[] (size_t i) const
 access specified element
 
constexpr value_tfront ()
 Access the first element.
 
constexpr const value_tfront () const
 Const Access the first element.
 
constexpr value_tback ()
 Access the first element.
 
constexpr const value_tback () const
 Const Access the first element.
 
Iteration
constexpr value_tbegin ()
 C++ Iterator Specification begin()
 
constexpr value_tend ()
 C++ Iterator Specification end()
 
constexpr const value_tbegin () const
 Const C++ Iterator Specification begin()
 
constexpr const value_tend () const
 Const C++ Iterator Specification end()
 

Public Attributes

Public Members
value_t data [ElemV]
 backing c-style array handle
 

Friends

Comparison Operators
constexpr bool_t operator== (const array &lhs, const array &rhs)
 Checks if all elements in the arrays are equal.
 
constexpr bool_t operator!= (const array &lhs, const array &rhs)
 Checks if any element in the arrays is not equal.
 

Member Function Documentation

◆ size()

template<typename ValueT , size_t ElemV>
constexpr size_t fennec::array< ValueT, ElemV >::size ( ) const
inlineconstexpr
Returns
the number of elements in the array

◆ empty()

template<typename ValueT , size_t ElemV>
constexpr bool_t fennec::array< ValueT, ElemV >::empty ( ) const
inlineconstexpr
Returns
\(ElemV == 0\)

◆ operator[]() [1/2]

template<typename ValueT , size_t ElemV>
constexpr value_t & fennec::array< ValueT, ElemV >::operator[] ( size_t  i)
inlineconstexpr

Returns a reference to the element at i

Parameters
iindex of the element to return
Returns
reference to the requested element
Time-Complexity
Constant
Space-Complexity
Constant

◆ operator[]() [2/2]

template<typename ValueT , size_t ElemV>
constexpr const value_t & fennec::array< ValueT, ElemV >::operator[] ( size_t  i) const
inlineconstexpr

Returns a reference to the element at i

Parameters
iindex of the element to return
Returns
reference to the requested element
Time-Complexity
Constant
Space-Complexity
Constant

◆ front() [1/2]

template<typename ValueT , size_t ElemV>
constexpr value_t & fennec::array< ValueT, ElemV >::front ( )
inlineconstexpr
Returns
A reference to the element at elements[0]

◆ front() [2/2]

template<typename ValueT , size_t ElemV>
constexpr const value_t & fennec::array< ValueT, ElemV >::front ( ) const
inlineconstexpr
Returns
A const-qualified reference to the element at elements[0]

◆ back() [1/2]

template<typename ValueT , size_t ElemV>
constexpr value_t & fennec::array< ValueT, ElemV >::back ( )
inlineconstexpr
Returns
A reference to the element at elements[ElemV - 1]

◆ back() [2/2]

template<typename ValueT , size_t ElemV>
constexpr const value_t & fennec::array< ValueT, ElemV >::back ( ) const
inlineconstexpr
Returns
A const-qualified reference to the element at elements[ElemV - 1]

◆ begin() [1/2]

template<typename ValueT , size_t ElemV>
constexpr value_t * fennec::array< ValueT, ElemV >::begin ( )
inlineconstexpr
Returns
A pointer to the first element of the array

◆ end() [1/2]

template<typename ValueT , size_t ElemV>
constexpr value_t * fennec::array< ValueT, ElemV >::end ( )
inlineconstexpr
Returns
A pointer to one after the end of the array

◆ begin() [2/2]

template<typename ValueT , size_t ElemV>
constexpr const value_t * fennec::array< ValueT, ElemV >::begin ( ) const
inlineconstexpr
Returns
A const-qualified pointer to the first element of the array

◆ end() [2/2]

template<typename ValueT , size_t ElemV>
constexpr const value_t * fennec::array< ValueT, ElemV >::end ( ) const
inlineconstexpr
Returns
A const-qualified pointer to one after the end of the array

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