class SmallVectorTemplateBase
Declaration
template <typename T,
bool = (is_trivially_copy_constructible<type - parameter -
0 - 0>::value) &&
(is_trivially_move_constructible<type - parameter -
0 - 0>::value) &&
std::is_trivially_destructible<type - parameter - 0 -
0>::value>
class SmallVectorTemplateBase { /* full declaration omitted */ };
Description
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.
Declared at: llvm/include/llvm/ADT/SmallVector.h:311
Templates
- T
- bool = (is_trivially_copy_constructible<type-parameter-0-0>::value) && (is_trivially_move_constructible<type-parameter-0-0>::value) && std::is_trivially_destructible<type-parameter-0-0>::value
Member Variables
- protected static const bool TakesParamByValue = false
Method Overview
- protected SmallVectorTemplateBase<T, >(size_t Size)
- protected static void destroy_range(T * S, T * E)
- protected static T && forward_value_param(T && V)
- protected static const T & forward_value_param(const T & V)
- protected void grow(size_t MinSize = 0)
- protected void growAndAssign(size_t NumElts, const T & Elt)
- protected template <typename... ArgTypes>T & growAndEmplaceBack(ArgTypes &&... Args)
- protected T * mallocForGrow(size_t MinSize, size_t & NewCapacity)
- protected void moveElementsForGrow(T * NewElts)
- public void pop_back()
- public void push_back(const T & Elt)
- public void push_back(T && Elt)
- protected const T * reserveForParamAndGetAddress(const T & Elt, size_t N = 1)
- protected T * reserveForParamAndGetAddress(T & Elt, size_t N = 1)
- protected void takeAllocationForGrow(T * NewElts, size_t NewCapacity)
- protected template <typename It1, typename It2>static void uninitialized_copy(It1 I, It1 E, It2 Dest)
- protected template <typename It1, typename It2>static void uninitialized_move(It1 I, It1 E, It2 Dest)
Methods
¶SmallVectorTemplateBase<T, >(size_t Size)
SmallVectorTemplateBase<T, >(size_t Size)
Declared at: llvm/include/llvm/ADT/SmallVector.h:318
Parameters
- size_t Size
¶static void destroy_range(T* S, T* E)
static void destroy_range(T* S, T* E)
Declared at: llvm/include/llvm/ADT/SmallVector.h:320
Parameters
- T* S
- T* E
¶static T&& forward_value_param(T&& V)
static T&& forward_value_param(T&& V)
Declared at: llvm/include/llvm/ADT/SmallVector.h:375
Parameters
- T&& V
¶static const T& forward_value_param(const T& V)
static const T& forward_value_param(const T& V)
Declared at: llvm/include/llvm/ADT/SmallVector.h:376
Parameters
- const T& V
¶void grow(size_t MinSize = 0)
void grow(size_t MinSize = 0)
Description
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.
Declared at: llvm/include/llvm/ADT/SmallVector.h:345
Parameters
- size_t MinSize = 0
¶void growAndAssign(size_t NumElts, const T& Elt)
void growAndAssign(size_t NumElts, const T& Elt)
Declared at: llvm/include/llvm/ADT/SmallVector.h:378
Parameters
- size_t NumElts
- const T& Elt
¶template <typename... ArgTypes>
T& growAndEmplaceBack(ArgTypes&&... Args)
template <typename... ArgTypes>
T& growAndEmplaceBack(ArgTypes&&... Args)
Declared at: llvm/include/llvm/ADT/SmallVector.h:388
Templates
- ArgTypes
Parameters
- ArgTypes&&... Args
¶T* mallocForGrow(size_t MinSize,
size_t& NewCapacity)
T* mallocForGrow(size_t MinSize,
size_t& NewCapacity)
Description
Create a new allocation big enough for \p MinSize and pass back its size in \p NewCapacity. This is the first section of \a grow().
Declared at: llvm/include/llvm/ADT/SmallVector.h:349
Parameters
- size_t MinSize
- size_t& NewCapacity
¶void moveElementsForGrow(T* NewElts)
void moveElementsForGrow(T* NewElts)
Description
Move existing elements over to the new allocation \p NewElts, the middle section of \a grow().
Declared at: llvm/include/llvm/ADT/SmallVector.h:357
Parameters
- T* NewElts
¶void pop_back()
void pop_back()
Declared at: llvm/include/llvm/ADT/SmallVector.h:412
¶void push_back(const T& Elt)
void push_back(const T& Elt)
Declared at: llvm/include/llvm/ADT/SmallVector.h:400
Parameters
- const T& Elt
¶void push_back(T&& Elt)
void push_back(T&& Elt)
Declared at: llvm/include/llvm/ADT/SmallVector.h:406
Parameters
- T&& Elt
¶const T* reserveForParamAndGetAddress(
const T& Elt,
size_t N = 1)
const T* reserveForParamAndGetAddress(
const T& Elt,
size_t N = 1)
Description
Reserve enough space to add one element, and return the updated element pointer in case it was a reference to the storage.
Declared at: llvm/include/llvm/ADT/SmallVector.h:364
Parameters
- const T& Elt
- size_t N = 1
¶T* reserveForParamAndGetAddress(T& Elt,
size_t N = 1)
T* reserveForParamAndGetAddress(T& Elt,
size_t N = 1)
Description
Reserve enough space to add one element, and return the updated element pointer in case it was a reference to the storage.
Declared at: llvm/include/llvm/ADT/SmallVector.h:370
Parameters
- T& Elt
- size_t N = 1
¶void takeAllocationForGrow(T* NewElts,
size_t NewCapacity)
void takeAllocationForGrow(T* NewElts,
size_t NewCapacity)
Description
Transfer ownership of the allocation, finishing up \a grow().
Declared at: llvm/include/llvm/ADT/SmallVector.h:360
Parameters
- T* NewElts
- size_t NewCapacity
¶template <typename It1, typename It2>
static void uninitialized_copy(It1 I,
It1 E,
It2 Dest)
template <typename It1, typename It2>
static void uninitialized_copy(It1 I,
It1 E,
It2 Dest)
Description
Copy the range [I, E) onto the uninitialized memory starting with "Dest", constructing elements as needed.
Declared at: llvm/include/llvm/ADT/SmallVector.h:338
Templates
- It1
- It2
Parameters
- It1 I
- It1 E
- It2 Dest
¶template <typename It1, typename It2>
static void uninitialized_move(It1 I,
It1 E,
It2 Dest)
template <typename It1, typename It2>
static void uninitialized_move(It1 I,
It1 E,
It2 Dest)
Description
Move the range [I, E) into the uninitialized memory starting with "Dest", constructing elements as needed.
Declared at: llvm/include/llvm/ADT/SmallVector.h:330
Templates
- It1
- It2
Parameters
- It1 I
- It1 E
- It2 Dest