July 2007
Intermediate to advanced
332 pages
10h 4m
English
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 delta elements to the end of the vector. The new elements are initialized with T(), where T is 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 n elements. The new elements are initialized with T(), where T is the type of the values in the vector.
size_t push_back( const_reference value );
Effects: atomically appends a copy of value to 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: const reference to the element with the specified index.