Concurrent growth¶
All member functions in this section can be performed concurrently with each other, element access methods and while traversing the container.
grow_by¶
iterator grow_by( size_type delta );Appends a sequence comprising
deltanew default-constructed in-place elements to the end of the vector.Returns: iterator to the beginning of the appended sequence.
Requirements: the type
value_typeshall meet theDefaultConstructibleandEmplaceConstructiblerequirements from [defaultconstructible] and [container.requirements] ISO C++ sections.
iterator grow_by( size_type delta, const value_type& value );Appends a sequence comprising
deltacopies ofvalueto the end of the vector.Returns: iterator to the beginning of the appended sequence.
Requirements: the type
value_typeshall meet theCopyInsertablerequirements from [container.requirements] ISO C++ Standard section.
template <typename InputIterator> iterator grow_by( InputIterator first, InputIterator last );Appends a sequence comprising all elements from the half-open interval
[first, last)to the end of the vector.Returns: iterator to the beginning of the appended sequence.
This overload only participates in overload resolution if the type
InputIteratormeets the requirements of InputIterator from [input.iterators] ISO C++ Standard section.
iterator grow_by( std::initializer_list<value_type> init );Equivalent to
grow_by(init.begin(), init.end()).
grow_to_at_least¶
iterator grow_to_at_least( size_type n );Appends minimal sequence of default constructed in-place elements such that
size() >= n.Returns: iterator to the beginning of the appended sequence.
Requirements: the type
value_typeshall meet theDefaultConstructibleandEmplaceConstructiblerequirements from [defaultconstructible] and [container.requirements] ISO C++ sections.
iterator grow_to_at_least( size_type n, const value_type& value );Appends minimal sequence of comprising copies of
valuesuch thatsize() >= n.Returns: iterator to the beginning of the appended sequence.
Requirements: the type
value_typeshall meet theCopyInsertablerequirements from [container.requirements] ISO C++ Standard section.
push_back¶
iterator push_back( const value_type& value );Appends a copy of
valueto the end of the vector.Returns: iterator to the appended element.
Requirements: the type
value_typeshall meet theCopyInsertablerequirements from [container.requirements] ISO C++ Standard section.
iterator push_back( value_type&& value );Appends
valueto the end of the vector using move semantics.
valueis left in a valid, but unspecified state.Returns: iterator to the appended element.
Requirements: the type
value_typeshall meet theMoveInsertablerequirements from [container.requirements] ISO C++ Standard section.
emplace_back¶
template <typename... Args> iterator emplace_back( Args&&... args );Appends an element constructed in-place from
argsto the end of the vector.Returns: iterator to the appended element.
Requirements: the type
value_typeshall meet theEmplaceConstructiblerequirements from [container.requirements] ISO C++ section.