Template Class SmallVector¶
Defined in File SmallVector.hpp
Inheritance Relationships¶
Base Types¶
public ams::SmallVectorImpl< T >(Template Class SmallVectorImpl)private ams::SmallVectorStorage< T, CalculateSmallVectorDefaultInlinedElements< T >::value >(Template Struct SmallVectorStorage)
Class Documentation¶
-
template<typename T, unsigned N = CalculateSmallVectorDefaultInlinedElements<T>::value>
class SmallVector : public ams::SmallVectorImpl<T>, private ams::SmallVectorStorage<T, CalculateSmallVectorDefaultInlinedElements<T>::value>¶ Forward declaration of SmallVector so that calculateSmallVectorDefaultInlinedElements can reference
sizeof(SmallVector<T, 0>).This is a ‘vector’ (really, a variable-sized array), optimized for the case when the array is small. It contains some number of elements in-place, which allows it to avoid heap allocation when the actual number of elements is below that threshold. This allows normal “small” cases to be fast without losing generality for large inputs.
Note
In the absence of a well-motivated choice for the number of inlined elements
N, it is recommended to useSmallVector<T>(that is, omitting theN). This will choose a default number of inlined elements reasonable for allocation on the stack (for example, trying to keepsizeof(SmallVector<T>)around 64 bytes).Warning
This does not attempt to be exception safe.
Public Functions
-
inline SmallVector()¶
-
inline ~SmallVector()¶
-
inline explicit SmallVector(size_t Size)¶
-
template<typename ItTy, typename = EnableIfConvertibleToInputIterator<ItTy>>
inline SmallVector(ItTy S, ItTy E)¶
-
template<typename RangeTy>
inline explicit SmallVector(const iterator_range<RangeTy> &R)¶
-
template<typename U, typename = std::enable_if_t<std::is_convertible<U, T>::value>>
inline explicit SmallVector(ArrayRef<U> A)¶
-
inline SmallVector(const SmallVector &RHS)¶
-
inline SmallVector &operator=(const SmallVector &RHS)¶
-
inline SmallVector(SmallVector &&RHS)¶
-
inline SmallVector(SmallVectorImpl<T> &&RHS)¶
-
inline SmallVector &operator=(SmallVector &&RHS)¶
-
inline SmallVector &operator=(SmallVectorImpl<T> &&RHS)¶
-
inline SmallVector &operator=(std::initializer_list<T> IL)¶
-
inline SmallVector()¶