PlayRho  2.0.0
An interactive physics engine & library.
playrho::ArrayList< T, MAXSIZE, SIZE_TYPE > Class Template Reference

Array list. More...

#include <playrho/ArrayList.hpp>

Inheritance diagram for playrho::ArrayList< T, MAXSIZE, SIZE_TYPE >:
[legend]

Public Types

using const_iterator = const value_type *
 Constant iterator type.
 
using const_pointer = const value_type *
 Constant pointer type.
 
using const_reference = const value_type &
 Constant reference type.
 
using iterator = value_type *
 Iterator type.
 
using pointer = value_type *
 Pointer type.
 
using reference = value_type &
 Reference type.
 
using size_type = SIZE_TYPE
 Size type.
 
using value_type = T
 Value type.
 

Public Member Functions

constexpr ArrayList () noexcept=default
 Default constructor. More...
 
constexpr ArrayList (const ArrayList &other) noexcept(std::is_nothrow_copy_assignable_v< T >)=default
 Copy constructor.
 
constexpr ArrayList (const Span< const value_type > &list)
 Initializing constructor.
 
constexpr ArrayList (std::initializer_list< value_type > list)
 Initializing constructor from initializer list. More...
 

Detailed Description

template<typename T, std::size_t MAXSIZE, typename SIZE_TYPE = std::size_t>
class playrho::ArrayList< T, MAXSIZE, SIZE_TYPE >

Array list.

This is a std::array backed std::vector like container. It provides vector like behavior whose max size is capped at the size given by the template max size parameter without using dynamic storage.

Constructor & Destructor Documentation

◆ ArrayList() [1/2]

template<typename T , std::size_t MAXSIZE, typename SIZE_TYPE = std::size_t>
constexpr playrho::ArrayList< T, MAXSIZE, SIZE_TYPE >::ArrayList ( )
constexprdefaultnoexcept

Default constructor.

Note
Some older versions of gcc have issues with this being defaulted.

◆ ArrayList() [2/2]

template<typename T , std::size_t MAXSIZE, typename SIZE_TYPE = std::size_t>
constexpr playrho::ArrayList< T, MAXSIZE, SIZE_TYPE >::ArrayList ( std::initializer_list< value_type list)
inlineconstexpr

Initializing constructor from initializer list.

Exceptions
LengthErrorif operation would exceed max_size().
See also
max_size.

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