Concurrently unsafe operations#
All member functions in this section can only be performed serially. The behavior is undefined in case of concurrent execution of these member functions with other (either concurrently safe) methods.
Reserving#
void reserve( size_type n );Reserves memory for at least
nelements.Throws:
std::length_errorifn > max_size().
Resizing#
void resize( size_type n );If
n < size(), the vector is reduced to its firstnelements.Otherwise, appends
n - size()new elements default-constructed in-place to the end of the vector.
void resize( size_type n, const value_type& value );If
n < size(), the vector is reduced to its firstnelements.Otherwise, appends
n - size()copies ofvalueto the end of the vector.
shrink_to_fit#
void shrink_to_fit();Removes the unused capacity of the vector.
Call for this method can also reorganize the internal vector representation in the memory.
clear#
void clear();Removes all elements from the container.
swap#
void swap( concurrent_vector& other ) noexcept(/*See below*/);Swaps contents of
*thisandother.Swaps allocators if
std::allocator_traits<allocator_type>::propagate_on_container_swap::valueistrue.Otherwise, if
get_allocator() != other.get_allocator(), the behavior is undefined.Exceptions:
noexceptspecification:noexcept(std::allocator_traits<allocator_type>::propagate_on_container_swap::value || std::allocator_traits<allocator_type>::is_always_equal::value