Concurrent Operations
The methods described in this section safely execute on the same instance of a concurrent_vector<T>:
-
size_type grow_by( size_type delta ) Effects: atomically appends
deltaelements to the end of the vector. The new elements are initialized withT(), whereTis the type of the values in the vector.Returns: old size of the vector. If it returns
k, the new elements are at the half-open index range [k…k+delta).-
void grow_to_at_least( size_type n ) Effects: grows the vector until it has at least
nelements. The new elements are initialized withT(), whereTis the type of the values in the vector.-
size_t push_back( const_reference value ); Effects: atomically appends a copy of
valueto the end of the vector.Returns: index of the copy.
-
reference operator[]( size_type index ) Returns: reference to the element with the specified index.
-
const_reference operator[]( size_type index )const; Returns:
constreference to the element with the specified index.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access