Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
beluga::CircularArray< T, N, F > Class Template Reference

An implementation of generic, non-threadsafe circular array. More...

#include <circular_array.hpp>

Public Types

using allocator_type = void
 Allocator type of the array (required in range-v3 10.0). More...
 
using const_iterator = IndexingIterator< const CircularArray< T, N, F > >
 Constant iterator type of the array. More...
 
using const_pointer = const value_type *
 Constant value pointer type of the arra.y. More...
 
using const_reference = const value_type &
 Constant value reference type of the array. More...
 
using const_reverse_iterator = std::reverse_iterator< const_iterator >
 Constant reverse iterator type of the array. More...
 
using difference_type = std::ptrdiff_t
 Size difference type of the array. More...
 
using iterator = IndexingIterator< CircularArray< T, N, F > >
 Iterator type of the array. More...
 
using pointer = value_type *
 Value pointer type of the array. More...
 
using reference = value_type &
 Value reference type of the array. More...
 
using reverse_iterator = std::reverse_iterator< iterator >
 Reverse iterator type of the array. More...
 
using size_type = std::size_t
 Size type of the array. More...
 
using value_type = T
 Value type of the array. More...
 

Public Member Functions

constexpr reference at (size_type index)
 Returns a reference to the array value at the given index. More...
 
constexpr const_reference at (size_type index) const
 Returns a constant reference to the array value at the given index. More...
 
constexpr const_reference back () const noexcept
 Returns a constant reference to the value at the back of the array. More...
 
constexpr reference back () noexcept
 Returns a reference to the value at the back of the array. More...
 
constexpr const_iterator begin () const noexcept
 Returns a constant iterator pointing to the front of the array. More...
 
constexpr iterator begin () noexcept
 Returns an iterator pointing to the front of the array. More...
 
constexpr const_iterator cbegin () const noexcept
 Returns a constant iterator pointing to the front of the array. More...
 
constexpr const_iterator cend () const noexcept
 Returns a constant iterator pointing past the back of the array. More...
 
 CircularArray ()=default
 Default constructor. More...
 
template<typename Iterator , typename Sentinel , typename = std::enable_if_t<std::is_same_v<T, typename std::iterator_traits<Iterator>::value_type>>>
 CircularArray (Iterator first, Sentinel last)
 Constructs array from a pair of iterators. More...
 
template<std::size_t M>
 CircularArray (T(&&data)[M])
 Constructs array from an aggregate. More...
 
void clear () noexcept
 Clears array. More...
 
constexpr const_reverse_iterator crbegin () const noexcept
 Returns a constant reverse iterator pointing to the back of the array. More...
 
constexpr const_reverse_iterator crend () const noexcept
 Returns a constant reverse iterator pointing past the front of the array. More...
 
constexpr const T * data () const noexcept
 Returns a constant pointer to the underlying array data. More...
 
constexpr T * data () noexcept
 Returns a pointer to the underlying array data. More...
 
constexpr size_type effective_size () const noexcept
 Returns the effective array size. More...
 
constexpr bool empty () const noexcept
 Returns true if the array is empty, false otherwise. More...
 
constexpr const_iterator end () const noexcept
 Returns a constant iterator pointing past the back of the array. More...
 
constexpr iterator end () noexcept
 Returns an iterator pointing past the back of the array. More...
 
void fill (const T &value)
 Fills array to its maximum size with a given value. More...
 
constexpr const_reference front () const noexcept
 Returns a constant reference to the value at the front of the array. More...
 
constexpr reference front () noexcept
 Returns a reference to the value at the front of the array. More...
 
constexpr bool full () const noexcept
 Returns true if the array is full, false otherwise. More...
 
constexpr size_type max_size () const noexcept
 Returns the maximum array size. More...
 
constexpr const_reference operator[] (size_type index) const noexcept
 Returns a constant reference to the array value at the given index. More...
 
constexpr reference operator[] (size_type index) noexcept
 Returns a reference to the array value at the given index. More...
 
template<bool Enabled = (F & CircularArrayFeatureFlags::kLayoutReversal)>
std::enable_if_t< Enabled > pop_back () noexcept
 Pops a value from the back of the array. More...
 
template<bool Enabled = !(F & CircularArrayFeatureFlags::kLayoutReversal)>
std::enable_if_t< Enabled > pop_front () noexcept
 Pops a value from the front of the array. More...
 
template<bool Enabled = !(F & CircularArrayFeatureFlags::kLayoutReversal)>
std::enable_if_t< Enabled > push_back (value_type value)
 Pushes a value to the back of the array. More...
 
template<bool Enabled = (F & CircularArrayFeatureFlags::kLayoutReversal)>
std::enable_if_t< Enabled > push_front (value_type value)
 Pushes a value at the front of the array. More...
 
constexpr const_reverse_iterator rbegin () const noexcept
 Returns a constant reverse iterator pointing to the back of the array. More...
 
constexpr reverse_iterator rbegin () noexcept
 Returns a reverse iterator pointing to the back of the array. More...
 
constexpr const_reverse_iterator rend () const noexcept
 Returns a constant reverse iterator pointing past the front of the array. More...
 
constexpr reverse_iterator rend () noexcept
 Returns a reverse iterator pointing past the front of the array. More...
 
constexpr size_type size () const noexcept
 Returns the current array size. More...
 
template<CircularArrayFeatureFlags G>
void swap (CircularArray< T, N, G > &other) noexcept(std::is_nothrow_swappable_v< T >)
 Swaps array with another. More...
 

Private Member Functions

constexpr size_type head_index () const noexcept
 

Private Attributes

std::array< T, N > data_
 
size_type size_ {0U}
 
size_type tail_index_ {0U}
 

Friends

template<typename U , std::size_t M, CircularArrayFeatureFlags G>
class CircularArray
 

Detailed Description

template<typename T, std::size_t N, CircularArrayFeatureFlags F = CircularArrayFeatureFlags::kNone>
class beluga::CircularArray< T, N, F >

An implementation of generic, non-threadsafe circular array.

Modelled after std::array. Its maximum size is fixed at compile-time. Most operations are O(1) but for a few that exhibit worse case O(N) (not considering the complexity of move-construction and move-assignment of array elements of type T). Additionally, it features optional indexing reversal (making it a LIFO rather than a FIFO data structure), optional back value extrapolation for constant read accesses, and optional rollover on write accesses (i.e. overwriting the oldest value when pushing to an array instance that is full).

Template Parameters
TElement type. It must be default constructible, move constructible, and move assignable.
NMaximum size. It must be a positive integer.
FArray feature flags, to enable optional functionality. It defaults to none.

Definition at line 76 of file circular_array.hpp.

Member Typedef Documentation

◆ allocator_type

template<typename T , std::size_t N, CircularArrayFeatureFlags F = CircularArrayFeatureFlags::kNone>
using beluga::CircularArray< T, N, F >::allocator_type = void

Allocator type of the array (required in range-v3 10.0).

Definition at line 94 of file circular_array.hpp.

◆ const_iterator

template<typename T , std::size_t N, CircularArrayFeatureFlags F = CircularArrayFeatureFlags::kNone>
using beluga::CircularArray< T, N, F >::const_iterator = IndexingIterator<const CircularArray<T, N, F> >

Constant iterator type of the array.

Definition at line 99 of file circular_array.hpp.

◆ const_pointer

template<typename T , std::size_t N, CircularArrayFeatureFlags F = CircularArrayFeatureFlags::kNone>
using beluga::CircularArray< T, N, F >::const_pointer = const value_type*

Constant value pointer type of the arra.y.

Definition at line 91 of file circular_array.hpp.

◆ const_reference

template<typename T , std::size_t N, CircularArrayFeatureFlags F = CircularArrayFeatureFlags::kNone>
using beluga::CircularArray< T, N, F >::const_reference = const value_type&

Constant value reference type of the array.

Definition at line 87 of file circular_array.hpp.

◆ const_reverse_iterator

template<typename T , std::size_t N, CircularArrayFeatureFlags F = CircularArrayFeatureFlags::kNone>
using beluga::CircularArray< T, N, F >::const_reverse_iterator = std::reverse_iterator<const_iterator>

Constant reverse iterator type of the array.

Definition at line 103 of file circular_array.hpp.

◆ difference_type

template<typename T , std::size_t N, CircularArrayFeatureFlags F = CircularArrayFeatureFlags::kNone>
using beluga::CircularArray< T, N, F >::difference_type = std::ptrdiff_t

Size difference type of the array.

Definition at line 83 of file circular_array.hpp.

◆ iterator

template<typename T , std::size_t N, CircularArrayFeatureFlags F = CircularArrayFeatureFlags::kNone>
using beluga::CircularArray< T, N, F >::iterator = IndexingIterator<CircularArray<T, N, F> >

Iterator type of the array.

Definition at line 97 of file circular_array.hpp.

◆ pointer

template<typename T , std::size_t N, CircularArrayFeatureFlags F = CircularArrayFeatureFlags::kNone>
using beluga::CircularArray< T, N, F >::pointer = value_type*

Value pointer type of the array.

Definition at line 89 of file circular_array.hpp.

◆ reference

template<typename T , std::size_t N, CircularArrayFeatureFlags F = CircularArrayFeatureFlags::kNone>
using beluga::CircularArray< T, N, F >::reference = value_type&

Value reference type of the array.

Definition at line 85 of file circular_array.hpp.

◆ reverse_iterator

template<typename T , std::size_t N, CircularArrayFeatureFlags F = CircularArrayFeatureFlags::kNone>
using beluga::CircularArray< T, N, F >::reverse_iterator = std::reverse_iterator<iterator>

Reverse iterator type of the array.

Definition at line 101 of file circular_array.hpp.

◆ size_type

template<typename T , std::size_t N, CircularArrayFeatureFlags F = CircularArrayFeatureFlags::kNone>
using beluga::CircularArray< T, N, F >::size_type = std::size_t

Size type of the array.

Definition at line 81 of file circular_array.hpp.

◆ value_type

template<typename T , std::size_t N, CircularArrayFeatureFlags F = CircularArrayFeatureFlags::kNone>
using beluga::CircularArray< T, N, F >::value_type = T

Value type of the array.

Definition at line 79 of file circular_array.hpp.

Constructor & Destructor Documentation

◆ CircularArray() [1/3]

template<typename T , std::size_t N, CircularArrayFeatureFlags F = CircularArrayFeatureFlags::kNone>
beluga::CircularArray< T, N, F >::CircularArray ( )
default

Default constructor.

Array will be functionally empty but storage will be default initialized.

◆ CircularArray() [2/3]

template<typename T , std::size_t N, CircularArrayFeatureFlags F = CircularArrayFeatureFlags::kNone>
template<typename Iterator , typename Sentinel , typename = std::enable_if_t<std::is_same_v<T, typename std::iterator_traits<Iterator>::value_type>>>
beluga::CircularArray< T, N, F >::CircularArray ( Iterator  first,
Sentinel  last 
)
inline

Constructs array from a pair of iterators.

Functionally equivalent to repeated push_back() operations or push_front() operations in reverse if the layout reversal feature is enabled. That is, both range and array layouts match.

Parameters
firstIterator to the beginning of a range.
lastSentinel for the end of a range.
Exceptions
std::length_errorIf the range does not fit in the array (and the rollover on write feature is not enabled).

Definition at line 126 of file circular_array.hpp.

◆ CircularArray() [3/3]

template<typename T , std::size_t N, CircularArrayFeatureFlags F = CircularArrayFeatureFlags::kNone>
template<std::size_t M>
beluga::CircularArray< T, N, F >::CircularArray ( T(&&)  data[M])
inlineexplicit

Constructs array from an aggregate.

Functionally equivalent to repeated push_back() operations or push_front() operations in reverse if the layout reversal feature is enabled. That is, both aggregate and array layouts match.

Parameters
dataAggregate data to initialize the array with. Its size must be in the [1, N] interval.

Definition at line 163 of file circular_array.hpp.

Member Function Documentation

◆ at() [1/2]

template<typename T , std::size_t N, CircularArrayFeatureFlags F = CircularArrayFeatureFlags::kNone>
constexpr reference beluga::CircularArray< T, N, F >::at ( size_type  index)
inlineconstexpr

Returns a reference to the array value at the given index.

Exceptions
std::out_of_rangeIf index is past the array's effective size.

Definition at line 320 of file circular_array.hpp.

◆ at() [2/2]

template<typename T , std::size_t N, CircularArrayFeatureFlags F = CircularArrayFeatureFlags::kNone>
constexpr const_reference beluga::CircularArray< T, N, F >::at ( size_type  index) const
inlineconstexpr

Returns a constant reference to the array value at the given index.

Exceptions
std::out_of_rangeIf index is past the array effective size.

Definition at line 331 of file circular_array.hpp.

◆ back() [1/2]

template<typename T , std::size_t N, CircularArrayFeatureFlags F = CircularArrayFeatureFlags::kNone>
constexpr const_reference beluga::CircularArray< T, N, F >::back ( ) const
inlineconstexprnoexcept

Returns a constant reference to the value at the back of the array.

Behavior is undefined when accessing the back of an empty array.

Definition at line 284 of file circular_array.hpp.

◆ back() [2/2]

template<typename T , std::size_t N, CircularArrayFeatureFlags F = CircularArrayFeatureFlags::kNone>
constexpr reference beluga::CircularArray< T, N, F >::back ( )
inlineconstexprnoexcept

Returns a reference to the value at the back of the array.

Behavior is undefined when accessing the back of an empty array.

Definition at line 273 of file circular_array.hpp.

◆ begin() [1/2]

template<typename T , std::size_t N, CircularArrayFeatureFlags F = CircularArrayFeatureFlags::kNone>
constexpr const_iterator beluga::CircularArray< T, N, F >::begin ( ) const
inlineconstexprnoexcept

Returns a constant iterator pointing to the front of the array.

Definition at line 176 of file circular_array.hpp.

◆ begin() [2/2]

template<typename T , std::size_t N, CircularArrayFeatureFlags F = CircularArrayFeatureFlags::kNone>
constexpr iterator beluga::CircularArray< T, N, F >::begin ( )
inlineconstexprnoexcept

Returns an iterator pointing to the front of the array.

Definition at line 174 of file circular_array.hpp.

◆ cbegin()

template<typename T , std::size_t N, CircularArrayFeatureFlags F = CircularArrayFeatureFlags::kNone>
constexpr const_iterator beluga::CircularArray< T, N, F >::cbegin ( ) const
inlineconstexprnoexcept

Returns a constant iterator pointing to the front of the array.

Definition at line 178 of file circular_array.hpp.

◆ cend()

template<typename T , std::size_t N, CircularArrayFeatureFlags F = CircularArrayFeatureFlags::kNone>
constexpr const_iterator beluga::CircularArray< T, N, F >::cend ( ) const
inlineconstexprnoexcept

Returns a constant iterator pointing past the back of the array.

Definition at line 185 of file circular_array.hpp.

◆ clear()

template<typename T , std::size_t N, CircularArrayFeatureFlags F = CircularArrayFeatureFlags::kNone>
void beluga::CircularArray< T, N, F >::clear ( )
inlinenoexcept

Clears array.

No value destructors are invoked.

Definition at line 384 of file circular_array.hpp.

◆ crbegin()

template<typename T , std::size_t N, CircularArrayFeatureFlags F = CircularArrayFeatureFlags::kNone>
constexpr const_reverse_iterator beluga::CircularArray< T, N, F >::crbegin ( ) const
inlineconstexprnoexcept

Returns a constant reverse iterator pointing to the back of the array.

Definition at line 192 of file circular_array.hpp.

◆ crend()

template<typename T , std::size_t N, CircularArrayFeatureFlags F = CircularArrayFeatureFlags::kNone>
constexpr const_reverse_iterator beluga::CircularArray< T, N, F >::crend ( ) const
inlineconstexprnoexcept

Returns a constant reverse iterator pointing past the front of the array.

Definition at line 199 of file circular_array.hpp.

◆ data() [1/2]

template<typename T , std::size_t N, CircularArrayFeatureFlags F = CircularArrayFeatureFlags::kNone>
constexpr const T* beluga::CircularArray< T, N, F >::data ( ) const
inlineconstexprnoexcept

Returns a constant pointer to the underlying array data.

Note that a circular array does not feature a contiguous layout in memory. Indices and distances between them for the array do not map to its data.

Definition at line 415 of file circular_array.hpp.

◆ data() [2/2]

template<typename T , std::size_t N, CircularArrayFeatureFlags F = CircularArrayFeatureFlags::kNone>
constexpr T* beluga::CircularArray< T, N, F >::data ( )
inlineconstexprnoexcept

Returns a pointer to the underlying array data.

Note that a circular array does not feature a contiguous layout in memory. Indices and distances between them for the array do not map to its data.

Definition at line 408 of file circular_array.hpp.

◆ effective_size()

template<typename T , std::size_t N, CircularArrayFeatureFlags F = CircularArrayFeatureFlags::kNone>
constexpr size_type beluga::CircularArray< T, N, F >::effective_size ( ) const
inlineconstexprnoexcept

Returns the effective array size.

Nominally, the effective array size is equal to the array size. If the last value extrapolation feature is enabled, however, the effective array size can only be 0 or N, when the array is empty and when the array is non-empty respectively.

Definition at line 436 of file circular_array.hpp.

◆ empty()

template<typename T , std::size_t N, CircularArrayFeatureFlags F = CircularArrayFeatureFlags::kNone>
constexpr bool beluga::CircularArray< T, N, F >::empty ( ) const
inlineconstexprnoexcept

Returns true if the array is empty, false otherwise.

Definition at line 421 of file circular_array.hpp.

◆ end() [1/2]

template<typename T , std::size_t N, CircularArrayFeatureFlags F = CircularArrayFeatureFlags::kNone>
constexpr const_iterator beluga::CircularArray< T, N, F >::end ( ) const
inlineconstexprnoexcept

Returns a constant iterator pointing past the back of the array.

Definition at line 183 of file circular_array.hpp.

◆ end() [2/2]

template<typename T , std::size_t N, CircularArrayFeatureFlags F = CircularArrayFeatureFlags::kNone>
constexpr iterator beluga::CircularArray< T, N, F >::end ( )
inlineconstexprnoexcept

Returns an iterator pointing past the back of the array.

Definition at line 181 of file circular_array.hpp.

◆ fill()

template<typename T , std::size_t N, CircularArrayFeatureFlags F = CircularArrayFeatureFlags::kNone>
void beluga::CircularArray< T, N, F >::fill ( const T &  value)
inline

Fills array to its maximum size with a given value.

Functionally equivalent to repeated push_back() operations or push_front() operations if the layout reversal feature is enabled until the array reaches its maximum size. Existing values are kept. Filling an array that is full is a no-op.

Definition at line 372 of file circular_array.hpp.

◆ front() [1/2]

template<typename T , std::size_t N, CircularArrayFeatureFlags F = CircularArrayFeatureFlags::kNone>
constexpr const_reference beluga::CircularArray< T, N, F >::front ( ) const
inlineconstexprnoexcept

Returns a constant reference to the value at the front of the array.

Behavior is undefined when accessing the front of an empty array.

Definition at line 308 of file circular_array.hpp.

◆ front() [2/2]

template<typename T , std::size_t N, CircularArrayFeatureFlags F = CircularArrayFeatureFlags::kNone>
constexpr reference beluga::CircularArray< T, N, F >::front ( )
inlineconstexprnoexcept

Returns a reference to the value at the front of the array.

Behavior is undefined when accessing the front of an empty array.

Definition at line 296 of file circular_array.hpp.

◆ full()

template<typename T , std::size_t N, CircularArrayFeatureFlags F = CircularArrayFeatureFlags::kNone>
constexpr bool beluga::CircularArray< T, N, F >::full ( ) const
inlineconstexprnoexcept

Returns true if the array is full, false otherwise.

Definition at line 418 of file circular_array.hpp.

◆ head_index()

template<typename T , std::size_t N, CircularArrayFeatureFlags F = CircularArrayFeatureFlags::kNone>
constexpr size_type beluga::CircularArray< T, N, F >::head_index ( ) const
inlineconstexprprivatenoexcept

Definition at line 446 of file circular_array.hpp.

◆ max_size()

template<typename T , std::size_t N, CircularArrayFeatureFlags F = CircularArrayFeatureFlags::kNone>
constexpr size_type beluga::CircularArray< T, N, F >::max_size ( ) const
inlineconstexprnoexcept

Returns the maximum array size.

Definition at line 427 of file circular_array.hpp.

◆ operator[]() [1/2]

template<typename T , std::size_t N, CircularArrayFeatureFlags F = CircularArrayFeatureFlags::kNone>
constexpr const_reference beluga::CircularArray< T, N, F >::operator[] ( size_type  index) const
inlineconstexprnoexcept

Returns a constant reference to the array value at the given index.

Behavior is undefined when index is greater than or equal to the array effective size.

Definition at line 354 of file circular_array.hpp.

◆ operator[]() [2/2]

template<typename T , std::size_t N, CircularArrayFeatureFlags F = CircularArrayFeatureFlags::kNone>
constexpr reference beluga::CircularArray< T, N, F >::operator[] ( size_type  index)
inlineconstexprnoexcept

Returns a reference to the array value at the given index.

Behavior is undefined when index is greater than or equal to the array size.

Definition at line 342 of file circular_array.hpp.

◆ pop_back()

template<typename T , std::size_t N, CircularArrayFeatureFlags F = CircularArrayFeatureFlags::kNone>
template<bool Enabled = (F & CircularArrayFeatureFlags::kLayoutReversal)>
std::enable_if_t<Enabled> beluga::CircularArray< T, N, F >::pop_back ( )
inlinenoexcept

Pops a value from the back of the array.

Only available when the layout reversal feature is enabled. Behavior is undefined when popping from the back of an empty array. No destructors are invoked on the value popped.

Definition at line 254 of file circular_array.hpp.

◆ pop_front()

template<typename T , std::size_t N, CircularArrayFeatureFlags F = CircularArrayFeatureFlags::kNone>
template<bool Enabled = !(F & CircularArrayFeatureFlags::kLayoutReversal)>
std::enable_if_t<Enabled> beluga::CircularArray< T, N, F >::pop_front ( )
inlinenoexcept

Pops a value from the front of the array.

Only available when the layout reversal feature is not enabled. Behavior is undefined when popping from the front of an empty array. No destructors are invoked on the value popped.

Definition at line 265 of file circular_array.hpp.

◆ push_back()

template<typename T , std::size_t N, CircularArrayFeatureFlags F = CircularArrayFeatureFlags::kNone>
template<bool Enabled = !(F & CircularArrayFeatureFlags::kLayoutReversal)>
std::enable_if_t<Enabled> beluga::CircularArray< T, N, F >::push_back ( value_type  value)
inline

Pushes a value to the back of the array.

Only available when the layout reversal feature is not enabled.

Exceptions
std::length_errorIf the array is full and the rollover on write feature is not enabled.

Definition at line 209 of file circular_array.hpp.

◆ push_front()

template<typename T , std::size_t N, CircularArrayFeatureFlags F = CircularArrayFeatureFlags::kNone>
template<bool Enabled = (F & CircularArrayFeatureFlags::kLayoutReversal)>
std::enable_if_t<Enabled> beluga::CircularArray< T, N, F >::push_front ( value_type  value)
inline

Pushes a value at the front of the array.

Only available when the layout reversal feature is enabled.

Exceptions
std::length_errorIf the array is full and the rollover on write feature is not enabled.

Definition at line 232 of file circular_array.hpp.

◆ rbegin() [1/2]

template<typename T , std::size_t N, CircularArrayFeatureFlags F = CircularArrayFeatureFlags::kNone>
constexpr const_reverse_iterator beluga::CircularArray< T, N, F >::rbegin ( ) const
inlineconstexprnoexcept

Returns a constant reverse iterator pointing to the back of the array.

Definition at line 190 of file circular_array.hpp.

◆ rbegin() [2/2]

template<typename T , std::size_t N, CircularArrayFeatureFlags F = CircularArrayFeatureFlags::kNone>
constexpr reverse_iterator beluga::CircularArray< T, N, F >::rbegin ( )
inlineconstexprnoexcept

Returns a reverse iterator pointing to the back of the array.

Definition at line 188 of file circular_array.hpp.

◆ rend() [1/2]

template<typename T , std::size_t N, CircularArrayFeatureFlags F = CircularArrayFeatureFlags::kNone>
constexpr const_reverse_iterator beluga::CircularArray< T, N, F >::rend ( ) const
inlineconstexprnoexcept

Returns a constant reverse iterator pointing past the front of the array.

Definition at line 197 of file circular_array.hpp.

◆ rend() [2/2]

template<typename T , std::size_t N, CircularArrayFeatureFlags F = CircularArrayFeatureFlags::kNone>
constexpr reverse_iterator beluga::CircularArray< T, N, F >::rend ( )
inlineconstexprnoexcept

Returns a reverse iterator pointing past the front of the array.

Definition at line 195 of file circular_array.hpp.

◆ size()

template<typename T , std::size_t N, CircularArrayFeatureFlags F = CircularArrayFeatureFlags::kNone>
constexpr size_type beluga::CircularArray< T, N, F >::size ( ) const
inlineconstexprnoexcept

Returns the current array size.

Definition at line 424 of file circular_array.hpp.

◆ swap()

template<typename T , std::size_t N, CircularArrayFeatureFlags F = CircularArrayFeatureFlags::kNone>
template<CircularArrayFeatureFlags G>
void beluga::CircularArray< T, N, F >::swap ( CircularArray< T, N, G > &  other)
inlinenoexcept

Swaps array with another.

Arrays being swapped may not necessarily have the same features enabled. This is most relevant when arrays differ in layout direction, as swapping two such arrays effectively reverses their elements.

Definition at line 393 of file circular_array.hpp.

Friends And Related Function Documentation

◆ CircularArray

template<typename T , std::size_t N, CircularArrayFeatureFlags F = CircularArrayFeatureFlags::kNone>
template<typename U , std::size_t M, CircularArrayFeatureFlags G>
friend class CircularArray
friend

Definition at line 401 of file circular_array.hpp.

Member Data Documentation

◆ data_

template<typename T , std::size_t N, CircularArrayFeatureFlags F = CircularArrayFeatureFlags::kNone>
std::array<T, N> beluga::CircularArray< T, N, F >::data_
private

Definition at line 450 of file circular_array.hpp.

◆ size_

template<typename T , std::size_t N, CircularArrayFeatureFlags F = CircularArrayFeatureFlags::kNone>
size_type beluga::CircularArray< T, N, F >::size_ {0U}
private

Definition at line 452 of file circular_array.hpp.

◆ tail_index_

template<typename T , std::size_t N, CircularArrayFeatureFlags F = CircularArrayFeatureFlags::kNone>
size_type beluga::CircularArray< T, N, F >::tail_index_ {0U}
private

Definition at line 451 of file circular_array.hpp.


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


beluga
Author(s):
autogenerated on Tue Jul 16 2024 02:59:54