template<typename T>
Death::Containers::SmallVectorImpl class

Common method implementations of SmallVector class to reduce code duplication based on N template parameter.

Template parameters
T Element type

Base classes

class SmallVectorTemplate<T>
Template method specializations of SmallVector depending on whether type is trivial or not.

Derived classes

template<typename T, unsigned N = CalculateSmallVectorDefaultInlinedElements<T>::value>
class SmallVector
Memory-optimized vector.

Public types

using iterator = typename BaseClass::iterator
Iterator type.
using const_iterator = typename BaseClass::const_iterator
Const iterator type.
using reference = typename BaseClass::reference
Reference type.
using size_type = typename BaseClass::size_type
Size type.

Constructors, destructors, conversion operators

SmallVectorImpl(unsigned n) protected explicit
~SmallVectorImpl() protected
SmallVectorImpl(const SmallVectorImpl&) deleted

Public functions

void clear()
Clears the vector.
void resize(size_type n)
Resizes the vector to given size, value-initializing new elements.
void resize_for_overwrite(size_type n)
Resizes the vector to given size, default-initializing new elements.
void resize(size_type n, ValueParamT nv)
Resizes the vector to given size, constructing new elements using provided argument.
void truncate(size_type n)
Like resize, but requires that n is less than size()
void reserve(size_type n)
Reserve given capacity in the vector.
void pop_back_n(size_type n)
Removes the last n elements.
auto pop_back_val() -> T
Removes the last element and returns it.
void swap(SmallVectorImpl& other)
Swaps the contents.
template<typename in_iter, std::enable_if_t<std::is_convertible<typename std::iterator_traits<in_iter>::iterator_category, std::input_iterator_tag>::value, int> = 0>
void append(in_iter inStart, in_iter inEnd)
Adds the specified range to the end of the vector.
void append(size_type n, ValueParamT elt)
Appends n copies of elt to the end.
void append(std::initializer_list<T> il)
Appends the specified list to the end.
void append(const SmallVectorImpl& other)
Appends the specified vector to the end.
void assign(size_type n, ValueParamT elt)
Assigns n copies of elt.
template<typename in_iter, std::enable_if_t<std::is_convertible<typename std::iterator_traits<in_iter>::iterator_category, std::input_iterator_tag>::value, int> = 0>
void assign(in_iter inStart, in_iter inEnd)
Assigns the specified range.
void assign(std::initializer_list<T> il)
Assigns the specified list.
void assign(const SmallVectorImpl& other)
Assigns the specified vector.
auto erase(const_iterator ci) -> iterator
Removes elements from the vector.
auto erase(const_iterator cs, const_iterator ce) -> iterator
void erase(size_type index)
auto eraseUnordered(const_iterator ci) -> iterator
Removes an element from the unordered vector.
void eraseUnordered(size_type index)
auto insert(iterator i, T&& elt) -> iterator
Inserts elements.
auto insert(iterator i, const T& elt) -> iterator
auto insert(iterator i, size_type numToInsert, ValueParamT elt) -> iterator
template<typename ItTy, std::enable_if_t<std::is_convertible<typename std::iterator_traits<ItTy>::iterator_category, std::input_iterator_tag>::value, int> = 0>
auto insert(iterator i, ItTy from, ItTy to) -> iterator
void insert(iterator i, std::initializer_list<T> il)
template<typename ... ArgTypes>
auto emplace_back(ArgTypes && ... args) -> reference
Constructs elements in-place at the end.
auto operator=(const SmallVectorImpl& other) -> SmallVectorImpl&
auto operator=(SmallVectorImpl&& other) -> SmallVectorImpl&
auto operator==(const SmallVectorImpl& other) const -> bool
auto operator!=(const SmallVectorImpl& other) const -> bool
auto operator<(const SmallVectorImpl& other) const -> bool
auto operator>(const SmallVectorImpl& other) const -> bool
auto operator<=(const SmallVectorImpl& other) const -> bool
auto operator>=(const SmallVectorImpl& other) const -> bool

Protected types

using ValueParamT = typename BaseClass::ValueParamT
Either const T& or T, depending on whether it's cheap enough to take parameters by value, always const T& for non-trivial types.

Function documentation

template<typename T>
iterator Death::Containers::SmallVectorImpl<T>::erase(const_iterator cs, const_iterator ce)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

template<typename T>
void Death::Containers::SmallVectorImpl<T>::erase(size_type index)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

template<typename T>
void Death::Containers::SmallVectorImpl<T>::eraseUnordered(size_type index)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

template<typename T>
iterator Death::Containers::SmallVectorImpl<T>::insert(iterator i, const T& elt)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

template<typename T>
iterator Death::Containers::SmallVectorImpl<T>::insert(iterator i, size_type numToInsert, ValueParamT elt)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

template<typename T> template<typename ItTy, std::enable_if_t<std::is_convertible<typename std::iterator_traits<ItTy>::iterator_category, std::input_iterator_tag>::value, int> = 0>
iterator Death::Containers::SmallVectorImpl<T>::insert(iterator i, ItTy from, ItTy to)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

template<typename T>
void Death::Containers::SmallVectorImpl<T>::insert(iterator i, std::initializer_list<T> il)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.