emlabcpp
modern opinionated embedded C++ library
emlabcpp::static_vector< T, N > Class Template Reference

Data container for up to N elements. More...

#include <static_vector.h>

Public Types

using value_type = T
 
using size_type = std::size_t
 
using reference = T &
 
using const_reference = T const &
 
using iterator = T *
 
using const_iterator = T const *
 

Public Member Functions

 static_vector ()=default
 
 static_vector (static_vector const &other)
 
 static_vector (static_vector &&other) noexcept
 
 static_vector (std::size_t M, T const &item)
 
template<std::size_t M>
 requires (M<=N) explicit static_vector(std
 
static_vectoroperator= (static_vector const &other)
 
static_vectoroperator= (static_vector &&other) noexcept
 
template<std::size_t M>
 requires (M<=N) static_vector &operator
 
template<typename Container >
void copy_from (Container const &cont)
 count of items More...
 
template<typename Container >
void move_from (Container &cont)
 
void purge ()
 Cleans entire buffer from items. More...
 

Public Attributes

size_type size_ = 0
 

Static Public Attributes

static constexpr std::size_t capacity = N
 

Detailed Description

template<typename T, std::size_t N>
class emlabcpp::static_vector< T, N >

Data container for up to N elements.

Member Typedef Documentation

◆ const_iterator

template<typename T , std::size_t N>
using emlabcpp::static_vector< T, N >::const_iterator = T const*

◆ const_reference

template<typename T , std::size_t N>
using emlabcpp::static_vector< T, N >::const_reference = T const&

◆ iterator

template<typename T , std::size_t N>
using emlabcpp::static_vector< T, N >::iterator = T*

◆ reference

template<typename T , std::size_t N>
using emlabcpp::static_vector< T, N >::reference = T&

◆ size_type

template<typename T , std::size_t N>
using emlabcpp::static_vector< T, N >::size_type = std::size_t

◆ value_type

template<typename T , std::size_t N>
using emlabcpp::static_vector< T, N >::value_type = T

Constructor & Destructor Documentation

◆ static_vector() [1/4]

template<typename T , std::size_t N>
emlabcpp::static_vector< T, N >::static_vector ( )
default

◆ static_vector() [2/4]

template<typename T , std::size_t N>
emlabcpp::static_vector< T, N >::static_vector ( static_vector< T, N > const &  other)
inline

◆ static_vector() [3/4]

template<typename T , std::size_t N>
emlabcpp::static_vector< T, N >::static_vector ( static_vector< T, N > &&  other)
inlinenoexcept

◆ static_vector() [4/4]

template<typename T , std::size_t N>
emlabcpp::static_vector< T, N >::static_vector ( std::size_t  M,
T const &  item 
)
inline

References emlabcpp::max(), and emlabcpp::N.

Member Function Documentation

◆ copy_from()

template<typename T , std::size_t N>
template<typename Container >
void emlabcpp::static_vector< T, N >::copy_from ( Container const &  cont)
inline

count of items

References emlabcpp::static_vector< T, N >::size_.

◆ move_from()

template<typename T , std::size_t N>
template<typename Container >
void emlabcpp::static_vector< T, N >::move_from ( Container &  cont)
inline

◆ operator=() [1/2]

template<typename T , std::size_t N>
static_vector& emlabcpp::static_vector< T, N >::operator= ( static_vector< T, N > &&  other)
inlinenoexcept

◆ operator=() [2/2]

template<typename T , std::size_t N>
static_vector& emlabcpp::static_vector< T, N >::operator= ( static_vector< T, N > const &  other)
inline

◆ purge()

template<typename T , std::size_t N>
void emlabcpp::static_vector< T, N >::purge ( )
inline

Cleans entire buffer from items.

References emlabcpp::static_vector< T, N >::size_.

◆ requires() [1/2]

template<typename T , std::size_t N>
template<std::size_t M>
emlabcpp::static_vector< T, N >::requires ( M<=  N)
inline

◆ requires() [2/2]

template<typename T , std::size_t N>
template<std::size_t M>
emlabcpp::static_vector< T, N >::requires ( M<=  N) &

Member Data Documentation

◆ capacity

template<typename T , std::size_t N>
constexpr std::size_t emlabcpp::static_vector< T, N >::capacity = N
staticconstexpr

◆ size_

template<typename T , std::size_t N>
size_type emlabcpp::static_vector< T, N >::size_ = 0

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