Arene Base
Fundamental Utilities For Safety Critical C++
Loading...
Searching...
No Matches
arene::base::const_vector_reference< T > Class Template Reference

A const reference class to an inline_vector object, with size-erased type. More...

Public Types

using const_iterator = typename inline_vector_detail::vector_base<T>::const_iterator
 The const iterator type of the underlying vector.
 
using iterator = const_iterator
 The iterator type to be used in this const context.
 
using size_type = std::size_t
 The size type.
 
using value_type = T
 The value type.
 

Public Member Functions

constexpr const_vector_reference (external_vector< T > const &vec)
 Construct a vector reference to the supplied external_vector.
 
template<std::size_t Capacity>
constexpr const_vector_reference (inline_vector< T, Capacity > const &vec)
 Construct a vector reference to the supplied inline_vector.
 
constexpr const_vector_reference (vector_reference< T > const ref)
 Construct a const reference out of a non-const one.
 
template<bool AreExceptionsEnabled = detail::are_exceptions_enabled::value, constraints< std::enable_if_t< AreExceptionsEnabled > > = nullptr>
constexpr auto at (size_type index) const -> T const &
 Obtain a const reference to the element with the specified index.
 
constexpr auto back () const noexcept -> T const &
 Get a const reference to the last element.
 
constexpr auto begin () const noexcept -> const_iterator
 Obtain a const iterator to the start of the vector.
 
constexpr auto capacity () const noexcept -> size_type
 Get the capacity.
 
constexpr auto cbegin () const noexcept -> const_iterator
 Obtain an const iterator to the start of the vector.
 
constexpr auto cend () const noexcept -> const_iterator
 Obtain a const iterator to the end of the vector.
 
constexpr auto data () const noexcept -> T const *
 Obtain a pointer to the stored elements.
 
constexpr auto empty () const noexcept -> bool
 Check if the vector is empty.
 
constexpr auto end () const noexcept -> const_iterator
 Obtain a const iterator to the end of the vector.
 
constexpr auto front () const noexcept -> T const &
 Get a const reference to the first element.
 
constexpr auto max_size () const noexcept -> size_type
 Check if the vector is empty.
 
constexpr auto operator[] (size_type index) const noexcept -> T const &
 Obtain a const reference to the element with the specified index.
 
constexpr auto size () const noexcept -> size_type
 Get the current number of live elements in the vector.
 

Detailed Description

template<typename T>
class arene::base::const_vector_reference< T >

A const reference class to an inline_vector object, with size-erased type.

Template Parameters
TThe type of each element

Member Typedef Documentation

◆ const_iterator

template<typename T>
using arene::base::const_vector_reference< T >::const_iterator = typename inline_vector_detail::vector_base<T>::const_iterator

The const iterator type of the underlying vector.

◆ iterator

template<typename T>
using arene::base::const_vector_reference< T >::iterator = const_iterator

The iterator type to be used in this const context.

◆ size_type

template<typename T>
using arene::base::const_vector_reference< T >::size_type = std::size_t

The size type.

◆ value_type

template<typename T>
using arene::base::const_vector_reference< T >::value_type = T

The value type.

Constructor & Destructor Documentation

◆ const_vector_reference() [1/3]

template<typename T>
template<std::size_t Capacity>
arene::base::const_vector_reference< T >::const_vector_reference ( inline_vector< T, Capacity > const & vec)
inlineexplicitconstexpr

Construct a vector reference to the supplied inline_vector.

Template Parameters
CapacityThe maximum number of elements that can be stored
Parameters
vecThe inline_vector to reference

◆ const_vector_reference() [2/3]

template<typename T>
arene::base::const_vector_reference< T >::const_vector_reference ( external_vector< T > const & vec)
inlineexplicitconstexpr

Construct a vector reference to the supplied external_vector.

Parameters
vecThe external_vector to reference

◆ const_vector_reference() [3/3]

template<typename T>
arene::base::const_vector_reference< T >::const_vector_reference ( vector_reference< T > const ref)
inlineexplicitconstexpr

Construct a const reference out of a non-const one.

Parameters
refThe non-const reference class

Member Function Documentation

◆ at()

template<typename T>
template<bool AreExceptionsEnabled = detail::are_exceptions_enabled::value, constraints< std::enable_if_t< AreExceptionsEnabled > > = nullptr>
auto arene::base::const_vector_reference< T >::at ( size_type index) const -> T const&
inlineconstexpr

Obtain a const reference to the element with the specified index.

Template Parameters
AreExceptionsEnabledUsed to disable this overload if exceptions are not enabled.
Parameters
indexThe index of the element
Returns
A reference to the element
Exceptions
std::out_of_rangeif the index is out of range

◆ back()

template<typename T>
auto arene::base::const_vector_reference< T >::back ( ) const -> T const&
inlineconstexprnoexcept

Get a const reference to the last element.

Returns
A reference to the lastelement
Precondition
The vector must not be empty

◆ begin()

template<typename T>
auto arene::base::const_vector_reference< T >::begin ( ) const -> const_iterator
inlineconstexprnoexcept

Obtain a const iterator to the start of the vector.

Returns
The iterator

◆ capacity()

template<typename T>
auto arene::base::const_vector_reference< T >::capacity ( ) const -> size_type
inlineconstexprnoexcept

Get the capacity.

Returns
the capacity

◆ cbegin()

template<typename T>
auto arene::base::const_vector_reference< T >::cbegin ( ) const -> const_iterator
inlineconstexprnoexcept

Obtain an const iterator to the start of the vector.

Returns
The iterator

◆ cend()

template<typename T>
auto arene::base::const_vector_reference< T >::cend ( ) const -> const_iterator
inlineconstexprnoexcept

Obtain a const iterator to the end of the vector.

Returns
The iterator

◆ data()

template<typename T>
auto arene::base::const_vector_reference< T >::data ( ) const -> T const*
inlineconstexprnoexcept

Obtain a pointer to the stored elements.

Returns
A raw pointer to the elements

◆ empty()

template<typename T>
auto arene::base::const_vector_reference< T >::empty ( ) const -> bool
inlineconstexprnoexcept

Check if the vector is empty.

Returns
true if the vector is empty, false otherwise

◆ end()

template<typename T>
auto arene::base::const_vector_reference< T >::end ( ) const -> const_iterator
inlineconstexprnoexcept

Obtain a const iterator to the end of the vector.

Returns
The iterator

◆ front()

template<typename T>
auto arene::base::const_vector_reference< T >::front ( ) const -> T const&
inlineconstexprnoexcept

Get a const reference to the first element.

Returns
A reference to the first element
Precondition
The vector must not be empty

◆ max_size()

template<typename T>
auto arene::base::const_vector_reference< T >::max_size ( ) const -> size_type
inlineconstexprnoexcept

Check if the vector is empty.

Returns
true if the vector is empty, false otherwise

◆ operator[]()

template<typename T>
auto arene::base::const_vector_reference< T >::operator[] ( size_type index) const -> T const&
inlineconstexprnoexcept

Obtain a const reference to the element with the specified index.

Parameters
indexThe index of the element
Returns
A reference to the element
Precondition
index must be less than size()

◆ size()

template<typename T>
auto arene::base::const_vector_reference< T >::size ( ) const -> size_type
inlineconstexprnoexcept

Get the current number of live elements in the vector.

Returns
the size

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