Common SmallVector functionality independent of whether T is POD.

Synopsis

Declared in <llvm/ADT/SmallVector.h>

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

Description

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.

Base Classes

Name

Description

SmallVectorBase<SmallVectorSizeType<T>>

This is all the stuff common to all SmallVectors.

Type Aliases

Name

Description

const_iterator

Const iterator over the vector elements.

const_pointer

Const pointer to an element.

const_reference

Const reference to an element.

const_reverse_iterator

Const reverse iterator over the vector elements.

difference_type

Signed type used to express the distance between iterators.

iterator

Mutable iterator over the vector elements.

pointer

Mutable pointer to an element.

reference

Mutable reference to an element.

reverse_iterator

Reverse iterator over the vector elements.

size_type

Unsigned type used to express the size of the vector.

value_type

Element type stored in the vector.

Member Functions

Name

Description

back

back overloads

begin

Return an iterator to the first element.

capacity

Return the number of elements the vector can hold without reallocating.

capacity_in_bytes

Return the number of bytes of allocated storage.

data

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

empty

Return true if the vector contains no elements.

end

Return an iterator past the last element.

front

front overloads

max_size

Return the maximum number of elements the vector can hold.

operator[]

Subscript operators

rbegin

rbegin overloads

rend

rend overloads

size

Return the number of elements in the vector.

size_in_bytes

Return the number of bytes used by the current elements.

Using Declarations

Name

Description

capacity

Inherit capacity() from SmallVectorBase.

empty

Inherit empty() from SmallVectorBase.

size

Inherit size() from SmallVectorBase.

Protected Member Functions

Name

Description

SmallVectorTemplateCommon [constructor]

Construct common SmallVector state with inline capacity SizeArg.

assertSafeToAdd

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

assertSafeToAddRange

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

assertSafeToReferenceAfterClear

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

assertSafeToReferenceAfterResize

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

getFirstEl

Return a pointer to the first element of inline storage.

grow_pod

grow_pod overloads

isRangeInStorage

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

isReferenceToRange

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

isReferenceToStorage

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

isSafeToReferenceAfterResize

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

isSmall

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

mallocForGrow

This is a helper for grow() that's out of line to reduce code duplication. This function will report a fatal error if it can't grow at least to MinSize.

resetToSmall

Put this vector in a state of being small.

set_allocation_range

Set the array data pointer to Begin and capacity to N.

set_size

Set the array size to N, which the current array must have enough capacity for.

Protected Static Member Functions

Name

Description

SizeTypeMax

The maximum value of the Size_T used.

reserveForParamAndGetAddressImpl

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

Protected Data Members

Name

Description

BeginX

Pointer to the first element, or inline storage.

Capacity

Number of elements the current storage can hold without reallocating.

Size

Number of constructed elements currently stored.

Derived Classes

Name

Description

SmallVectorTemplateBase<T, true>

SmallVector methods specialized for trivially copyable element types.

SmallVectorTemplateBase

SmallVectorTemplateBase<TriviallyCopyable = false> ‐ This is where we put method implementations that are designed to work with non‐trivial T's.

Created with MrDocs