Template Class SmallVectorTemplateBase< T, true >

Inheritance Relationships

Base Type

Class Documentation

template<typename T>
class SmallVectorTemplateBase<T, true> : public ams::SmallVectorTemplateCommon<T>

SmallVectorTemplateBase<TriviallyCopyable = true> - This is where we put method implementations that are designed to work with trivially copyable T’s. This allows using memcpy in place of copy/move construction and skipping destruction.

Public Functions

inline void push_back(ValueParamT Elt)
inline void pop_back()

Protected Types

using ValueParamT = std::conditional_t<TakesParamByValue, T, const T&>

Either const T& or T, depending on whether it’s cheap enough to take parameters by value.

Protected Functions

inline SmallVectorTemplateBase(size_t Size)
inline void grow(size_t MinSize = 0)

Double the size of the allocated memory, guaranteeing space for at least one more element or MinSize if specified.

inline const T *reserveForParamAndGetAddress(const T &Elt, size_t N = 1)

Reserve enough space to add one element, and return the updated element pointer in case it was a reference to the storage.

inline T *reserveForParamAndGetAddress(T &Elt, size_t N = 1)

Reserve enough space to add one element, and return the updated element pointer in case it was a reference to the storage.

inline void growAndAssign(size_t NumElts, T Elt)
template<typename ...ArgTypes>
inline T &growAndEmplaceBack(ArgTypes&&... Args)

Protected Static Functions

static inline void destroy_range(T*, T*)
template<typename It1, typename It2>
static inline void uninitialized_move(It1 I, It1 E, It2 Dest)

Move the range [I, E) onto the uninitialized memory starting with “Dest”, constructing elements into it as needed.

template<typename It1, typename It2>
static inline void uninitialized_copy(It1 I, It1 E, It2 Dest)

Copy the range [I, E) onto the uninitialized memory starting with “Dest”, constructing elements into it as needed.

template<typename T1, typename T2>
static inline void uninitialized_copy(T1 *I, T1 *E, T2 *Dest, std::enable_if_t<std::is_same<std::remove_const_t<T1>, T2>::value>* = nullptr)

Copy the range [I, E) onto the uninitialized memory starting with “Dest”, constructing elements into it as needed.

static inline ValueParamT forward_value_param(ValueParamT V)

Copy V or return a reference, depending on ValueParamT.

Protected Static Attributes

static constexpr bool TakesParamByValue = sizeof(T) <= 2 * sizeof(void*)

True if it’s cheap enough to take parameters by value. Doing so avoids overhead related to mitigations for reference invalidation.