Concurrently unsafe operations
Contents
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
n
elements.Throws:
std::length_error
ifn > max_size()
.
Resizing#
void resize( size_type n );If
n < size()
, the vector is reduced to its firstn
elements.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 firstn
elements.Otherwise, appends
n - size()
copies ofvalue
to 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
*this
andother
.Swaps allocators if
std::allocator_traits<allocator_type>::propagate_on_container_swap::value
istrue
.Otherwise, if
get_allocator() != other.get_allocator()
, the behavior is undefined.Exceptions:
noexcept
specification:noexcept(std::allocator_traits<allocator_type>::propagate_on_container_swap::value || std::allocator_traits<allocator_type>::is_always_equal::value