Template Class SmallVectorTemplateBase¶
Defined in File SmallVector.hpp
Inheritance Relationships¶
Base Type¶
public ams::SmallVectorTemplateCommon< T >(Template Class SmallVectorTemplateCommon)
Derived Types¶
public ams::SmallVectorImpl< IntDimType >(Template Class SmallVectorImpl)public ams::SmallVectorImpl< T >(Template Class SmallVectorImpl)
Class Documentation¶
-
template<typename T, bool = (std::is_trivially_copy_constructible<T>::value)&&(std::is_trivially_move_constructible<T>::value)&&std::is_trivially_destructible<T>::value>
class SmallVectorTemplateBase : public ams::SmallVectorTemplateCommon<T>¶ SmallVectorTemplateBase<TriviallyCopyable = false> - This is where we put method implementations that are designed to work with non-trivial T’s.
We approximate is_trivially_copyable with trivial move/copy construction and trivial destruction. While the standard doesn’t specify that you’re allowed copy these types with memcpy, there is no way for the type to observe this. This catches the important case of std::pair<POD, POD>, which is not trivially assignable.
Subclassed by ams::SmallVectorImpl< IntDimType >, ams::SmallVectorImpl< T >
Public Functions
-
inline void pop_back()¶
Protected Functions
-
inline SmallVectorTemplateBase(size_t Size)¶
-
void grow(size_t MinSize = 0)¶
Grow the allocated memory (without initializing new elements), doubling the size of the allocated memory. Guarantees space for at least one more element, or MinSize more elements if specified.
-
T *mallocForGrow(size_t MinSize, size_t &NewCapacity)¶
Create a new allocation big enough for
MinSizeand pass back its size inNewCapacity. This is the first section of grow().
-
void moveElementsForGrow(T *NewElts)¶
Move existing elements over to the new allocation
NewElts, the middle section of grow().
-
void takeAllocationForGrow(T *NewElts, size_t NewCapacity)¶
Transfer ownership of the allocation, finishing up grow().
-
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.
Protected Static Functions
-
template<typename It1, typename It2>
static inline void uninitialized_move(It1 I, It1 E, It2 Dest)¶ Move the range [I, E) into the uninitialized memory starting with “Dest”, constructing elements as needed. We expose a C++14 API, so we cannot directly call uninitialized_move that was intorduced on C++17. This is equivalent.
Protected Static Attributes
-
static constexpr bool TakesParamByValue = false¶
-
inline void pop_back()¶