Construction, destruction, copying¶
Empty container constructors¶
concurrent_vector(); explicit concurrent_vector( const allocator_type& alloc );Constructs an empty
concurrent_vector.If provided, uses the allocator
allocto allocate the memory.
Constructors from the sequence of elements¶
explicit concurrent_vector( size_type count, const value_type& value, const allocator_type& alloc = allocator_type() );Constructs a
concurrent_vectorcontainingcountcopies of thevalueusing the allocatoralloc.
explicit concurrent_vector( size_type count, const allocator_type& alloc = allocator_type() );Constructs a
concurrent_vectorcontainingndefault constructed in-place elements using the allocatoralloc.
template <typename InputIterator> concurrent_vector( InputIterator first, InputIterator last, const allocator_type& alloc = allocator_type() );Constructs a
concurrent_vectorcontains all elements from the half-open interval[first, last)using the allocatoralloc.Requirements: the type
InputIteratorshall meet the requirements ofInputIteratorfrom [input.iterators] ISO C++ Standard section.
concurrent_vector( std::initializer_list<value_type> init, const allocator_type& alloc = allocator_type() );Equivalent to
concurrent_vector(init.begin(), init.end(), alloc).
Copying constructors¶
concurrent_vector( const concurrent_vector& other ); concurrent_vector( const concurrent_vector& other, const allocator_type& alloc );Constructs a copy of
other.If the allocator argument is not provided, it is obtained by calling
std::allocator_traits<allocator_type>::select_on_container_copy_construction(other.get_allocator()).The behavior is undefined in case of concurrent operations with
other.
Moving constructors¶
concurrent_vector( concurrent_vector&& other ); concurrent_vector( concurrent_vector&& other, const allocator_type& alloc );Constructs a
concurrent_vectorwith the contents ofotherusing move semantics.
otheris left in a valid, but unspecified state.If the allocator argument is not provided, it is obtained by calling
std::move(other.get_allocator()).The behavior is undefined in case of concurrent operations with
other.
Destructor¶
~concurrent_vector();Destroys the
concurrent_vector. Calls destructors of the stored elements and deallocates the used storage.The behavior is undefined in case of concurrent operations with
*this.
Assignment operators¶
concurrent_vector& operator=( const concurrent_vector& other );Replaces all elements in
*thisby the copies of the elements inother.Copy assigns allocators if
std::allocator_traits<allocator_type>::propagate_on_container_copy_assignment::valueistrue.The behavior is undefined in case of concurrent operations with
*thisandother.Returns: a reference to
*this.
concurrent_vector& operator=( concurrent_vector&& other ) noexcept(/*See below*/);Replaces all elements in
*thisby the elements inotherusing move semantics.
otheris left in a valid, but unspecified state.Move assigns allocators if
std::allocator_traits<allocator_type>::propagate_on_container_move_assignment::valueistrue.The behavior is undefined in case of concurrent operations with
*thisandother.Returns: a reference to
*this.Exceptions:
noexceptspecification:noexcept(std::allocator_traits<allocator_type>::propagate_on_container_move_assignment::value || std::allocator_traits<allocator_type>::is_always_equal::value)
concurrent_vector& operator=( std::initializer_list<value_type> init );Replaces all elements in
*thisby the elements ininit.The behavior is undefined in case of concurrent operations with
*this.Returns: a reference to
*this.
assign¶
void assign( size_type count, const value_type& value );Replaces all elements in
*thisbycountcopies ofvalue.
template <typename InputIterator> void assign( InputIterator first, InputIterator last );Replaces all elements in
*thisby the elements from the half-open interval[first, last).This overload only participates in overload resolution if the type
InputIteratormeets the requirements of InputIterator from [input.iterators] ISO C++ Standard section.
void assign( std::initializer_list<value_type> init );Equivalent to
assign(init.begin(), init.end()).
get_allocator¶
allocator_type get_allocator() const;Returns: a copy of the allocator associated with
*this.