ndtree
nd-octree data-structure and algorithms
ndtree::v1::stack_vector< T, capacity_ > Struct Template Reference

Description

template<class T, std::size_t capacity_>
struct ndtree::v1::stack_vector< T, capacity_ >

Vector with stack storage.

TODO: this is far from good (but it works for me TM)

  • make it actually zero size for capacity == 0
  • constexpr constructor/destructor for trivially default constructible and trivially destructible types?
  • implement the rest of the std::vector interface
  • make it as exception safe as possible
  • document undefined behavior

Public Member Functions

constexpr size_type size () const noexcept
 Size of the vector.
 
constexpr bool empty () const noexcept
 Is the vector empty?
 
constexpr size_type max_size () const noexcept
 Maximum number of elements that can be allocated in the vector. More...
 
constexpr size_type capacity () const noexcept
 Maximum number of elements that can be allocated in the vector.
 
constexpr T * data () noexcept
 Pointer to the vector's data.
 
constexpr const T * data () const noexcept
 Pointer to the vector's data.
 
constexpr iterator begin () noexcept
 Begin iterator.
 
constexpr const_iterator begin () const noexcept
 Begin iterator.
 
constexpr const_iterator cbegin () const noexcept
 Begin const iterator.
 
constexpr iterator end () noexcept
 End iterator.
 
constexpr const_iterator end () const noexcept
 End iterator.
 
constexpr const_iterator cend () const noexcept
 End const iterator.
 

Member Function Documentation

template<class T , std::size_t capacity_>
constexpr size_type ndtree::v1::stack_vector< T, capacity_ >::max_size ( ) const
noexcept

Maximum number of elements that can be allocated in the vector.

Note: just to be compatible with std::vector

References ndtree::v1::stack_vector< T, capacity_ >::capacity().