LLGL 0.05 Beta
Loading...
Searching...
No Matches
LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy > Class Template Reference

Generic container class for consecutive arrays optimized for small sizes. More...

#include <SmallVector.h>

Public Types

using value_type = T
using size_type = std::size_t
using difference_type = std::ptrdiff_t
using reference = value_type&
using const_reference = const value_type&
using pointer = value_type*
using const_pointer = const value_type*
using iterator = value_type*
using const_iterator = const value_type*
using reverse_iterator = std::reverse_iterator<iterator>
using const_reverse_iterator = std::reverse_iterator<const_iterator>

Public Member Functions

 SmallVector ()
 Default initializes an empty vector.
 SmallVector (const SmallVector &other)
 Initializes the vector with a copy of all elements from the other vector.
template<typename OtherT, std::size_t OtherLocalCapacity, typename OtherAllocator, typename OtherGrowStrategy>
 SmallVector (const SmallVector< OtherT, OtherLocalCapacity, OtherAllocator, OtherGrowStrategy > &other)
 Initializes the vector with a copy of all elements from the other vector of different type.
 SmallVector (SmallVector &&other)
 Takes the ownership of dynamically allocated elements from the other vector or copies all elements if the dynamic allocation is not used yet.
template<typename InputIter>
 SmallVector (InputIter from, InputIter to)
 Initializes the vector with the specified elements in the half-open range [from, to).
 SmallVector (const std::initializer_list< T > &list)
 Initializes the vector with a copy of all elements from the specified initializer list.
template<template< typename, typename > class OtherContainer, typename OtherAllocator>
 SmallVector (const OtherContainer< T, OtherAllocator > &other)
 Initializes the vector with a copy of all elements from the other generic container.
 SmallVector (ArrayView< T > list)
 Initializes the vector with a copy of all elements from the specified array view.
template<std::size_t N>
 SmallVector (const T(&data)[N])
 Initializes the vector with a copy of all elements from the specified data with a fixed size array.
 SmallVector (size_type count)
 Initializes the vector with the specified number of elements and initial default value.
 SmallVector (size_type count, const value_type &value)
 Initializes the vector with the specified number of elements and initial value.
 SmallVector (size_type count, UninitializeTag)
 Pre-allocates the vector with the specified number of elements but keeps them all uninitialized.
 ~SmallVector ()
 Destroys all elements in this vector.
bool empty () const noexcept
 Returns true if this vector is empty.
size_type size () const noexcept
 Returns the size (in number of elements) of this vector.
size_type capacity () const noexcept
 Returns the internal capacity (in number of elements) of this vector. This refers to the memory allocated for this vector.
pointer data () noexcept
 Returns a pointer to the beginning of this vector.
const_pointer data () const noexcept
 Returns a constant pointer to the beginning of this vector.
reference at (size_type pos)
 Returns a reference to the element at the specified position in this vector.
const_reference at (size_type pos) const
 Returns a constant reference to the element at the specified position in this vector.
reference front ()
 Returns a reference to first element in this vector.
const_reference front () const
 Returns a constant reference to first element in this vector.
reference back ()
 Returns a reference to last element in this vector.
const_reference back () const
 Returns a constant reference to last element in this vector.
void clear ()
 Destroys all elements in this vector.
void resize (size_type size)
 Resizes this vector to the new size and default initializes all newly allocated elements.
void resize (size_type size, const value_type &value)
 Resizes this vector to the new size and explicitly initializes all newly allocated elements.
void resize (size_type size, UninitializeTag)
 Resizes this vector to the new size and explicitly keeps all newly elements uninitialized.
void reserve (size_type size)
 Reserves memory for this vector to hold at least size elements.
void shrink_to_fit ()
 Re-allocates the internal memory for this vector to fit precisely the current number of elements.
void push_back (const value_type &value)
void push_back (value_type &&value)
void pop_back ()
iterator insert (const_iterator pos, const value_type &value)
template<typename InputIter>
iterator insert (const_iterator pos, InputIter from, InputIter to)
iterator insert (const_iterator pos, const std::initializer_list< T > &list)
iterator erase (const_iterator pos)
iterator erase (const_iterator from, const_iterator to)
void swap (SmallVector &other)
iterator begin () noexcept
const_iterator begin () const noexcept
const_iterator cbegin () const noexcept
reverse_iterator rbegin ()
const_reverse_iterator rbegin () const
const_reverse_iterator crbegin () const
iterator end () noexcept
const_iterator end () const noexcept
const_iterator cend () const noexcept
reverse_iterator rend ()
const_reverse_iterator rend () const
const_reverse_iterator crend () const
SmallVector & operator= (const SmallVector &rhs)
template<typename OtherT, std::size_t OtherLocalCapacity, typename OtherAllocator, typename OtherGrowStrategy>
SmallVector & operator= (const SmallVector< OtherT, OtherLocalCapacity, OtherAllocator, OtherGrowStrategy > &rhs)
SmallVector & operator= (SmallVector &&rhs)
 Takes the ownership of dynamically allocated elements from the rhs vector or copies all elements if the dynamic allocation is not used yet.
const_reference operator[] (size_type pos) const
reference operator[] (size_type pos)
 operator ArrayView< T > () const

Detailed Description

template<typename T, std::size_t LocalCapacity = 16, typename Allocator = std::allocator<T>, typename GrowStrategy = GrowStrategyAddHalf>
class LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy >

Generic container class for consecutive arrays optimized for small sizes.

Template Parameters
TSpecifies the array element type.
LocalCapacitySpecifies the capacity of the local buffer. Up to this number of elements no dynamic memory allocation is necessary. By default 16.
AllocatorSpecifies the memory allocator. This has to be compatible with std::allocator. By default std::allocator<T>.
GrowStrategySpecifies the strategy to grow the internal storage when the container switched to heap allocations. By default GrowStrategyAddHalf.

Member Typedef Documentation

◆ const_iterator

template<typename T, std::size_t LocalCapacity = 16, typename Allocator = std::allocator<T>, typename GrowStrategy = GrowStrategyAddHalf>
using LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy >::const_iterator = const value_type*

◆ const_pointer

template<typename T, std::size_t LocalCapacity = 16, typename Allocator = std::allocator<T>, typename GrowStrategy = GrowStrategyAddHalf>
using LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy >::const_pointer = const value_type*

◆ const_reference

template<typename T, std::size_t LocalCapacity = 16, typename Allocator = std::allocator<T>, typename GrowStrategy = GrowStrategyAddHalf>
using LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy >::const_reference = const value_type&

◆ const_reverse_iterator

template<typename T, std::size_t LocalCapacity = 16, typename Allocator = std::allocator<T>, typename GrowStrategy = GrowStrategyAddHalf>
using LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy >::const_reverse_iterator = std::reverse_iterator<const_iterator>

◆ difference_type

template<typename T, std::size_t LocalCapacity = 16, typename Allocator = std::allocator<T>, typename GrowStrategy = GrowStrategyAddHalf>
using LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy >::difference_type = std::ptrdiff_t

◆ iterator

template<typename T, std::size_t LocalCapacity = 16, typename Allocator = std::allocator<T>, typename GrowStrategy = GrowStrategyAddHalf>
using LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy >::iterator = value_type*

◆ pointer

template<typename T, std::size_t LocalCapacity = 16, typename Allocator = std::allocator<T>, typename GrowStrategy = GrowStrategyAddHalf>
using LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy >::pointer = value_type*

◆ reference

template<typename T, std::size_t LocalCapacity = 16, typename Allocator = std::allocator<T>, typename GrowStrategy = GrowStrategyAddHalf>
using LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy >::reference = value_type&

◆ reverse_iterator

template<typename T, std::size_t LocalCapacity = 16, typename Allocator = std::allocator<T>, typename GrowStrategy = GrowStrategyAddHalf>
using LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy >::reverse_iterator = std::reverse_iterator<iterator>

◆ size_type

template<typename T, std::size_t LocalCapacity = 16, typename Allocator = std::allocator<T>, typename GrowStrategy = GrowStrategyAddHalf>
using LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy >::size_type = std::size_t

◆ value_type

template<typename T, std::size_t LocalCapacity = 16, typename Allocator = std::allocator<T>, typename GrowStrategy = GrowStrategyAddHalf>
using LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy >::value_type = T

Constructor & Destructor Documentation

◆ SmallVector() [1/12]

template<typename T, std::size_t LocalCapacity = 16, typename Allocator = std::allocator<T>, typename GrowStrategy = GrowStrategyAddHalf>
LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy >::SmallVector ( )
inline

Default initializes an empty vector.

◆ SmallVector() [2/12]

template<typename T, std::size_t LocalCapacity = 16, typename Allocator = std::allocator<T>, typename GrowStrategy = GrowStrategyAddHalf>
LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy >::SmallVector ( const SmallVector< T, LocalCapacity, Allocator, GrowStrategy > & other)
inline

Initializes the vector with a copy of all elements from the other vector.

◆ SmallVector() [3/12]

template<typename T, std::size_t LocalCapacity = 16, typename Allocator = std::allocator<T>, typename GrowStrategy = GrowStrategyAddHalf>
template<typename OtherT, std::size_t OtherLocalCapacity, typename OtherAllocator, typename OtherGrowStrategy>
LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy >::SmallVector ( const SmallVector< OtherT, OtherLocalCapacity, OtherAllocator, OtherGrowStrategy > & other)
inline

Initializes the vector with a copy of all elements from the other vector of different type.

◆ SmallVector() [4/12]

template<typename T, std::size_t LocalCapacity = 16, typename Allocator = std::allocator<T>, typename GrowStrategy = GrowStrategyAddHalf>
LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy >::SmallVector ( SmallVector< T, LocalCapacity, Allocator, GrowStrategy > && other)
inline

Takes the ownership of dynamically allocated elements from the other vector or copies all elements if the dynamic allocation is not used yet.

Remarks
This function is intentionally not marked noexcept because we have to copy the data in case the vector is static.

◆ SmallVector() [5/12]

template<typename T, std::size_t LocalCapacity = 16, typename Allocator = std::allocator<T>, typename GrowStrategy = GrowStrategyAddHalf>
template<typename InputIter>
LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy >::SmallVector ( InputIter from,
InputIter to )
inline

Initializes the vector with the specified elements in the half-open range [from, to).

◆ SmallVector() [6/12]

template<typename T, std::size_t LocalCapacity = 16, typename Allocator = std::allocator<T>, typename GrowStrategy = GrowStrategyAddHalf>
LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy >::SmallVector ( const std::initializer_list< T > & list)
inline

Initializes the vector with a copy of all elements from the specified initializer list.

◆ SmallVector() [7/12]

template<typename T, std::size_t LocalCapacity = 16, typename Allocator = std::allocator<T>, typename GrowStrategy = GrowStrategyAddHalf>
template<template< typename, typename > class OtherContainer, typename OtherAllocator>
LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy >::SmallVector ( const OtherContainer< T, OtherAllocator > & other)
inline

Initializes the vector with a copy of all elements from the other generic container.

◆ SmallVector() [8/12]

template<typename T, std::size_t LocalCapacity = 16, typename Allocator = std::allocator<T>, typename GrowStrategy = GrowStrategyAddHalf>
LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy >::SmallVector ( ArrayView< T > list)
inline

Initializes the vector with a copy of all elements from the specified array view.

◆ SmallVector() [9/12]

template<typename T, std::size_t LocalCapacity = 16, typename Allocator = std::allocator<T>, typename GrowStrategy = GrowStrategyAddHalf>
template<std::size_t N>
LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy >::SmallVector ( const T(&) data[N])
inline

Initializes the vector with a copy of all elements from the specified data with a fixed size array.

Remarks
The size of this container will be equal to the template parameter <N>.

◆ SmallVector() [10/12]

template<typename T, std::size_t LocalCapacity = 16, typename Allocator = std::allocator<T>, typename GrowStrategy = GrowStrategyAddHalf>
LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy >::SmallVector ( size_type count)
inlineexplicit

Initializes the vector with the specified number of elements and initial default value.

◆ SmallVector() [11/12]

template<typename T, std::size_t LocalCapacity = 16, typename Allocator = std::allocator<T>, typename GrowStrategy = GrowStrategyAddHalf>
LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy >::SmallVector ( size_type count,
const value_type & value )
inlineexplicit

Initializes the vector with the specified number of elements and initial value.

◆ SmallVector() [12/12]

template<typename T, std::size_t LocalCapacity = 16, typename Allocator = std::allocator<T>, typename GrowStrategy = GrowStrategyAddHalf>
LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy >::SmallVector ( size_type count,
UninitializeTag  )
inlineexplicit

Pre-allocates the vector with the specified number of elements but keeps them all uninitialized.

◆ ~SmallVector()

template<typename T, std::size_t LocalCapacity = 16, typename Allocator = std::allocator<T>, typename GrowStrategy = GrowStrategyAddHalf>
LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy >::~SmallVector ( )
inline

Destroys all elements in this vector.

Member Function Documentation

◆ at() [1/2]

template<typename T, std::size_t LocalCapacity = 16, typename Allocator = std::allocator<T>, typename GrowStrategy = GrowStrategyAddHalf>
reference LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy >::at ( size_type pos)
inline

Returns a reference to the element at the specified position in this vector.

Remarks
This must not be called on an empty vector!

◆ at() [2/2]

template<typename T, std::size_t LocalCapacity = 16, typename Allocator = std::allocator<T>, typename GrowStrategy = GrowStrategyAddHalf>
const_reference LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy >::at ( size_type pos) const
inline

Returns a constant reference to the element at the specified position in this vector.

Remarks
This must not be called on an empty vector!

◆ back() [1/2]

template<typename T, std::size_t LocalCapacity = 16, typename Allocator = std::allocator<T>, typename GrowStrategy = GrowStrategyAddHalf>
reference LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy >::back ( )
inline

Returns a reference to last element in this vector.

Remarks
This must not be called on an empty vector!

◆ back() [2/2]

template<typename T, std::size_t LocalCapacity = 16, typename Allocator = std::allocator<T>, typename GrowStrategy = GrowStrategyAddHalf>
const_reference LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy >::back ( ) const
inline

Returns a constant reference to last element in this vector.

Remarks
This must not be called on an empty vector!

◆ begin() [1/2]

template<typename T, std::size_t LocalCapacity = 16, typename Allocator = std::allocator<T>, typename GrowStrategy = GrowStrategyAddHalf>
const_iterator LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy >::begin ( ) const
inlinenoexcept

◆ begin() [2/2]

template<typename T, std::size_t LocalCapacity = 16, typename Allocator = std::allocator<T>, typename GrowStrategy = GrowStrategyAddHalf>
iterator LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy >::begin ( )
inlinenoexcept

◆ capacity()

template<typename T, std::size_t LocalCapacity = 16, typename Allocator = std::allocator<T>, typename GrowStrategy = GrowStrategyAddHalf>
size_type LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy >::capacity ( ) const
inlinenoexcept

Returns the internal capacity (in number of elements) of this vector. This refers to the memory allocated for this vector.

◆ cbegin()

template<typename T, std::size_t LocalCapacity = 16, typename Allocator = std::allocator<T>, typename GrowStrategy = GrowStrategyAddHalf>
const_iterator LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy >::cbegin ( ) const
inlinenoexcept

◆ cend()

template<typename T, std::size_t LocalCapacity = 16, typename Allocator = std::allocator<T>, typename GrowStrategy = GrowStrategyAddHalf>
const_iterator LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy >::cend ( ) const
inlinenoexcept

◆ clear()

template<typename T, std::size_t LocalCapacity = 16, typename Allocator = std::allocator<T>, typename GrowStrategy = GrowStrategyAddHalf>
void LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy >::clear ( )
inline

Destroys all elements in this vector.

Remarks
After this call, size() returns 0 but capacity() is unchanged.

◆ crbegin()

template<typename T, std::size_t LocalCapacity = 16, typename Allocator = std::allocator<T>, typename GrowStrategy = GrowStrategyAddHalf>
const_reverse_iterator LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy >::crbegin ( ) const
inline

◆ crend()

template<typename T, std::size_t LocalCapacity = 16, typename Allocator = std::allocator<T>, typename GrowStrategy = GrowStrategyAddHalf>
const_reverse_iterator LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy >::crend ( ) const
inline

◆ data() [1/2]

template<typename T, std::size_t LocalCapacity = 16, typename Allocator = std::allocator<T>, typename GrowStrategy = GrowStrategyAddHalf>
const_pointer LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy >::data ( ) const
inlinenoexcept

Returns a constant pointer to the beginning of this vector.

◆ data() [2/2]

template<typename T, std::size_t LocalCapacity = 16, typename Allocator = std::allocator<T>, typename GrowStrategy = GrowStrategyAddHalf>
pointer LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy >::data ( )
inlinenoexcept

Returns a pointer to the beginning of this vector.

◆ empty()

template<typename T, std::size_t LocalCapacity = 16, typename Allocator = std::allocator<T>, typename GrowStrategy = GrowStrategyAddHalf>
bool LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy >::empty ( ) const
inlinenoexcept

Returns true if this vector is empty.

◆ end() [1/2]

template<typename T, std::size_t LocalCapacity = 16, typename Allocator = std::allocator<T>, typename GrowStrategy = GrowStrategyAddHalf>
const_iterator LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy >::end ( ) const
inlinenoexcept

◆ end() [2/2]

template<typename T, std::size_t LocalCapacity = 16, typename Allocator = std::allocator<T>, typename GrowStrategy = GrowStrategyAddHalf>
iterator LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy >::end ( )
inlinenoexcept

◆ erase() [1/2]

template<typename T, std::size_t LocalCapacity = 16, typename Allocator = std::allocator<T>, typename GrowStrategy = GrowStrategyAddHalf>
iterator LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy >::erase ( const_iterator from,
const_iterator to )
inline

◆ erase() [2/2]

template<typename T, std::size_t LocalCapacity = 16, typename Allocator = std::allocator<T>, typename GrowStrategy = GrowStrategyAddHalf>
iterator LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy >::erase ( const_iterator pos)
inline

◆ front() [1/2]

template<typename T, std::size_t LocalCapacity = 16, typename Allocator = std::allocator<T>, typename GrowStrategy = GrowStrategyAddHalf>
reference LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy >::front ( )
inline

Returns a reference to first element in this vector.

Remarks
This must not be called on an empty vector!

◆ front() [2/2]

template<typename T, std::size_t LocalCapacity = 16, typename Allocator = std::allocator<T>, typename GrowStrategy = GrowStrategyAddHalf>
const_reference LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy >::front ( ) const
inline

Returns a constant reference to first element in this vector.

Remarks
This must not be called on an empty vector!

◆ insert() [1/3]

template<typename T, std::size_t LocalCapacity = 16, typename Allocator = std::allocator<T>, typename GrowStrategy = GrowStrategyAddHalf>
iterator LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy >::insert ( const_iterator pos,
const std::initializer_list< T > & list )
inline

◆ insert() [2/3]

template<typename T, std::size_t LocalCapacity = 16, typename Allocator = std::allocator<T>, typename GrowStrategy = GrowStrategyAddHalf>
iterator LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy >::insert ( const_iterator pos,
const value_type & value )
inline

◆ insert() [3/3]

template<typename T, std::size_t LocalCapacity = 16, typename Allocator = std::allocator<T>, typename GrowStrategy = GrowStrategyAddHalf>
template<typename InputIter>
iterator LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy >::insert ( const_iterator pos,
InputIter from,
InputIter to )
inline

◆ operator ArrayView< T >()

template<typename T, std::size_t LocalCapacity = 16, typename Allocator = std::allocator<T>, typename GrowStrategy = GrowStrategyAddHalf>
LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy >::operator ArrayView< T > ( ) const
inline

◆ operator=() [1/3]

template<typename T, std::size_t LocalCapacity = 16, typename Allocator = std::allocator<T>, typename GrowStrategy = GrowStrategyAddHalf>
SmallVector & LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy >::operator= ( const SmallVector< T, LocalCapacity, Allocator, GrowStrategy > & rhs)
inline

◆ operator=() [2/3]

template<typename T, std::size_t LocalCapacity = 16, typename Allocator = std::allocator<T>, typename GrowStrategy = GrowStrategyAddHalf>
template<typename OtherT, std::size_t OtherLocalCapacity, typename OtherAllocator, typename OtherGrowStrategy>
SmallVector & LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy >::operator= ( const SmallVector< OtherT, OtherLocalCapacity, OtherAllocator, OtherGrowStrategy > & rhs)
inline

◆ operator=() [3/3]

template<typename T, std::size_t LocalCapacity = 16, typename Allocator = std::allocator<T>, typename GrowStrategy = GrowStrategyAddHalf>
SmallVector & LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy >::operator= ( SmallVector< T, LocalCapacity, Allocator, GrowStrategy > && rhs)
inline

Takes the ownership of dynamically allocated elements from the rhs vector or copies all elements if the dynamic allocation is not used yet.

Remarks
This function is intentionally not marked noexcept because we have to copy the data in case the vector is static.

◆ operator[]() [1/2]

template<typename T, std::size_t LocalCapacity = 16, typename Allocator = std::allocator<T>, typename GrowStrategy = GrowStrategyAddHalf>
reference LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy >::operator[] ( size_type pos)
inline

◆ operator[]() [2/2]

template<typename T, std::size_t LocalCapacity = 16, typename Allocator = std::allocator<T>, typename GrowStrategy = GrowStrategyAddHalf>
const_reference LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy >::operator[] ( size_type pos) const
inline

◆ pop_back()

template<typename T, std::size_t LocalCapacity = 16, typename Allocator = std::allocator<T>, typename GrowStrategy = GrowStrategyAddHalf>
void LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy >::pop_back ( )
inline

◆ push_back() [1/2]

template<typename T, std::size_t LocalCapacity = 16, typename Allocator = std::allocator<T>, typename GrowStrategy = GrowStrategyAddHalf>
void LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy >::push_back ( const value_type & value)
inline

◆ push_back() [2/2]

template<typename T, std::size_t LocalCapacity = 16, typename Allocator = std::allocator<T>, typename GrowStrategy = GrowStrategyAddHalf>
void LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy >::push_back ( value_type && value)
inline

◆ rbegin() [1/2]

template<typename T, std::size_t LocalCapacity = 16, typename Allocator = std::allocator<T>, typename GrowStrategy = GrowStrategyAddHalf>
reverse_iterator LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy >::rbegin ( )
inline

◆ rbegin() [2/2]

template<typename T, std::size_t LocalCapacity = 16, typename Allocator = std::allocator<T>, typename GrowStrategy = GrowStrategyAddHalf>
const_reverse_iterator LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy >::rbegin ( ) const
inline

◆ rend() [1/2]

template<typename T, std::size_t LocalCapacity = 16, typename Allocator = std::allocator<T>, typename GrowStrategy = GrowStrategyAddHalf>
reverse_iterator LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy >::rend ( )
inline

◆ rend() [2/2]

template<typename T, std::size_t LocalCapacity = 16, typename Allocator = std::allocator<T>, typename GrowStrategy = GrowStrategyAddHalf>
const_reverse_iterator LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy >::rend ( ) const
inline

◆ reserve()

template<typename T, std::size_t LocalCapacity = 16, typename Allocator = std::allocator<T>, typename GrowStrategy = GrowStrategyAddHalf>
void LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy >::reserve ( size_type size)
inline

Reserves memory for this vector to hold at least size elements.

Parameters
[in]sizeSpecifies the minimum reserved capacity. The initial capacity is equal to the template argument LocalCapacity. If the new size is smaller than or equal to the current capacity, this function has no effect.
Remarks
After this call, capacity() returns a value that is greater than or equal to the input parameter size.

◆ resize() [1/3]

template<typename T, std::size_t LocalCapacity = 16, typename Allocator = std::allocator<T>, typename GrowStrategy = GrowStrategyAddHalf>
void LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy >::resize ( size_type size)
inline

Resizes this vector to the new size and default initializes all newly allocated elements.

Parameters
[in]sizeSpecifies the new vector size (in number of elements).
Remarks
After this call, size() returns the same value as the input parameter size.
See also
resize(size_type, const value_type&)

◆ resize() [2/3]

template<typename T, std::size_t LocalCapacity = 16, typename Allocator = std::allocator<T>, typename GrowStrategy = GrowStrategyAddHalf>
void LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy >::resize ( size_type size,
const value_type & value )
inline

Resizes this vector to the new size and explicitly initializes all newly allocated elements.

Parameters
[in]sizeSpecifies the new vector size (in number of elements).
[in]valueSpecifies the value all newly allocated elements will be initialized with.
Remarks
After this call, size() returns the same value as the input parameter size.
See also
resize(size_type)

◆ resize() [3/3]

template<typename T, std::size_t LocalCapacity = 16, typename Allocator = std::allocator<T>, typename GrowStrategy = GrowStrategyAddHalf>
void LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy >::resize ( size_type size,
UninitializeTag  )
inline

Resizes this vector to the new size and explicitly keeps all newly elements uninitialized.

Parameters
[in]sizeSpecifies the new vector size (in number of elements).
Remarks
After this call, size() returns the same value as the input parameter size.
See also
resize(size_type)

◆ shrink_to_fit()

template<typename T, std::size_t LocalCapacity = 16, typename Allocator = std::allocator<T>, typename GrowStrategy = GrowStrategyAddHalf>
void LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy >::shrink_to_fit ( )
inline

Re-allocates the internal memory for this vector to fit precisely the current number of elements.

Remarks
After this call, capacity() returns the same value as size().

◆ size()

template<typename T, std::size_t LocalCapacity = 16, typename Allocator = std::allocator<T>, typename GrowStrategy = GrowStrategyAddHalf>
size_type LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy >::size ( ) const
inlinenoexcept

Returns the size (in number of elements) of this vector.

◆ swap()

template<typename T, std::size_t LocalCapacity = 16, typename Allocator = std::allocator<T>, typename GrowStrategy = GrowStrategyAddHalf>
void LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy >::swap ( SmallVector< T, LocalCapacity, Allocator, GrowStrategy > & other)
inline

Member Data Documentation

◆ cap_

template<typename T, std::size_t LocalCapacity = 16, typename Allocator = std::allocator<T>, typename GrowStrategy = GrowStrategyAddHalf>
size_type LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy >::cap_

◆ local_

template<typename T, std::size_t LocalCapacity = 16, typename Allocator = std::allocator<T>, typename GrowStrategy = GrowStrategyAddHalf>
AlignedArray<T, LocalCapacity> LLGL::SmallVector< T, LocalCapacity, Allocator, GrowStrategy >::local_

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