concurrent_vector::reserve Method

Allocates enough space to grow the concurrent vector to size _N without having to allocate more memory later. This method is not concurrency-safe.

void reserve(
   size_type _N


  • _N
    The number of elements to reserve space for.


reserve is not concurrency-safe. You must ensure that no other threads are invoking methods on the concurrent vector when you call this method. The capacity of the concurrent vector after the method returns may be bigger than the requested reservation.


Header: concurrent_vector.h

Namespace: concurrency

See Also


concurrent_vector Class