#include <Containers/SmallVector.h>
template<typename T>
SmallVectorTemplateCommon class
SmallVector part which does not depend on whether the type is a POD
Base classes
-
template<class Size_T>class SmallVectorBase<SmallVectorSizeType<T>>
- SmallVector base class
Derived classes
-
template<typename T, bool = (std::class SmallVectorTemplateBase
is_trivially_copy_constructible<T>::value)&& (std:: is_trivially_move_constructible<T>::value)&& std:: is_trivially_destructible<T>::value> - SmallVector method implementations that are designed to work with non-trivial types
-
template<typename T>class SmallVectorTemplateBase<T, true>
- SmallVector method implementations that are designed to work with trivially copyable types
Public types
-
using size_type = std::
size_t -
using difference_type = std::
ptrdiff_t - using value_type = T
- using iterator = T*
- using const_iterator = const T*
-
using const_reverse_iterator = std::
reverse_iterator<const_iterator> -
using reverse_iterator = std::
reverse_iterator<iterator> - using reference = T&
- using const_reference = const T&
- using pointer = T*
- using const_pointer = const T*
Constructors, destructors, conversion operators
-
SmallVectorTemplateCommon(std::
size_t Size) protected
Public functions
- auto begin() -> iterator
- auto begin() const -> const_iterator
- auto end() -> iterator
- auto end() const -> const_iterator
-
auto rbegin() -> reverse_
iterator -
auto rbegin() const -> const_
reverse_ iterator -
auto rend() -> reverse_
iterator -
auto rend() const -> const_
reverse_ iterator -
auto size_in_bytes() const -> size_
type -
auto max_size() const -> size_
type -
auto capacity_in_bytes() const -> std::
size_t - auto data() -> pointer
- Returns a pointer to the vector's buffer.
- auto data() const -> const_pointer
-
auto operator[](size_
type idx) -> reference -
auto operator[](size_
type idx) const -> const_reference - auto front() -> reference
- auto front() const -> const_reference
- auto back() -> reference
- auto back() const -> const_reference
Protected static functions
-
template<class U>static auto reserveForParamAndGetAddressImpl(U* _this, const T& elt, std::
size_t n) -> const T* - Reserves enough space to add one element, and return the updated element pointer in case it was a reference to the storage.
Protected functions
- auto getFirstEl() const -> void*
- Finds the address of the first element.
-
void growPod(std::
size_t minSize, std:: size_t typeSize) - auto isSmall() const -> bool
- Returns
true
if this is a vector which has not had dynamic memory allocated for it. - void resetToSmall()
- Puts this vector in a state of being small.
- auto isReferenceToRange(const void* v, const void* first, const void* last) const -> bool
- Returns true if
V
is an internal reference to the given range. - auto isReferenceToStorage(const void* v) const -> bool
- Return
true
ifV
is an internal reference to this vector. - auto isRangeInStorage(const void* first, const void* last) const -> bool
- Returns
true
ifFirst
andLast
form a valid (possibly empty) range in this vector's storage. -
auto isSafeToReferenceAfterResize(const void* elt,
std::
size_t newSize) -> bool - Returns true unless
Elt
will be invalidated by resizing the vector toNewSize
. -
void assertSafeToReferenceAfterResize(const void* elt,
std::
size_t newSize) - Checks whether
Elt
will be invalidated by resizing the vector toNewSize
. -
void assertSafeToAdd(const void* elt,
std::
size_t n = 1) - Checks whether
Elt
will be invalidated by increasing the size of the vector by N. - void assertSafeToReferenceAfterClear(const T* from, const T* to)
- Checks whether any part of the range will be invalidated by clearing.
-
template<class ItTy, std::void assertSafeToReferenceAfterClear(ItTy, ItTy)
enable_if_t<!std:: is_same<std:: remove_const_t<ItTy>, T*>::value, bool> = false> - void assertSafeToAddRange(const T* from, const T* to)
- Checks whether any part of the range will be invalidated by growing.
-
template<class ItTy, std::void assertSafeToAddRange(ItTy, ItTy)
enable_if_t<!std:: is_same<std:: remove_const_t<ItTy>, T*>::value, bool> = false>
Function documentation
template<typename T>
const_pointer Death:: Containers:: SmallVectorTemplateCommon<T>:: data() const
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:: SmallVectorTemplateCommon<T>:: getFirstEl() const protected
Finds the address of the first element.
For this pointer math to be valid with small-size of 0 for T
with lots of alignment, it's important that SmallVectorStorage
is properly-aligned even for small-size of 0