Template Class SmallVectorTemplateCommon

Inheritance Relationships

Base Type

Derived Types

Class Documentation

template<typename T, typename = void>
class SmallVectorTemplateCommon : public ams::SmallVectorBase<SmallVectorSizeType<T>>

This is the part of SmallVectorTemplateBase which does not depend on whether the type T is a POD. The extra dummy template argument is used by ArrayRef to avoid unnecessarily requiring T to be complete.

Subclassed by ams::SmallVectorTemplateBase< IntDimType >, ams::SmallVectorTemplateBase< T, bool >, ams::SmallVectorTemplateBase< T, true >

Public Types

using size_type = size_t
using difference_type = 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*

Public Functions

inline iterator begin()
inline const_iterator begin() const
inline iterator end()
inline const_iterator end() const
inline reverse_iterator rbegin()
inline const_reverse_iterator rbegin() const
inline reverse_iterator rend()
inline const_reverse_iterator rend() const
inline size_type size_in_bytes() const
inline size_type max_size() const
inline size_t capacity_in_bytes() const
inline pointer data()

Return a pointer to the vector’s buffer, even if empty().

inline const_pointer data() const

Return a pointer to the vector’s buffer, even if empty().

inline reference operator[](size_type idx)
inline const_reference operator[](size_type idx) const
inline reference front()
inline const_reference front() const
inline reference back()
inline const_reference back() const

Protected Functions

inline void *getFirstEl() const

Find 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.

inline SmallVectorTemplateCommon(size_t Size)
inline void grow_pod(size_t MinSize, size_t TSize)
inline bool isSmall() const

Return true if this is a smallvector which has not had dynamic memory allocated for it.

inline void resetToSmall()

Put this vector in a state of being small.

inline bool isReferenceToRange(const void *V, const void *First, const void *Last) const

Return true if V is an internal reference to the given range.

inline bool isReferenceToStorage(const void *V) const

Return true if V is an internal reference to this vector.

inline bool isRangeInStorage(const void *First, const void *Last) const

Return true if First and Last form a valid (possibly empty) range in this vector’s storage.

inline bool isSafeToReferenceAfterResize(const void *Elt, size_t NewSize)

Return true unless Elt will be invalidated by resizing the vector to NewSize.

inline void assertSafeToReferenceAfterResize(const void *Elt, size_t NewSize)

Check whether Elt will be invalidated by resizing the vector to NewSize.

inline void assertSafeToAdd(const void *Elt, size_t N = 1)

Check whether Elt will be invalidated by increasing the size of the vector by N.

inline void assertSafeToReferenceAfterClear(const T *From, const T *To)

Check whether any part of the range will be invalidated by clearing.

template<class ItTy, std::enable_if_t<!std::is_same<std::remove_const_t<ItTy>, T*>::value, bool> = false>
inline void assertSafeToReferenceAfterClear(ItTy, ItTy)
inline void assertSafeToAddRange(const T *From, const T *To)

Check whether any part of the range will be invalidated by growing.

template<class ItTy, std::enable_if_t<!std::is_same<std::remove_const_t<ItTy>, T*>::value, bool> = false>
inline void assertSafeToAddRange(ItTy, ItTy)

Protected Static Functions

template<class U>
static inline const T *reserveForParamAndGetAddressImpl(U *This, const T &Elt, size_t N)

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