Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

concurrent_vector::resize Method

Changes the size of the concurrent vector to the requested size, deleting or adding elements as necessary. This method is not concurrency-safe.

void resize(
   size_type _N
void resize(
   size_type _N,
   const _Ty& _Val


The new size of the concurrent vector.


The value of new elements added to the vector if the new size is larger that the original size. If the value is omitted, the new objects are assigned the default value for their type.

If the size of the container is less than the requested size, elements are added to the vector until it reaches the requested size. If the size of the container is larger than the requested size, the elements closest to the end of the container are deleted until the container reaches the size _N. If the present size of the container is the same as the requested size, no action is taken.

resize is not concurrency safe. You must ensure that no other threads are invoking methods on the concurrent vector when you call this method.

Header: concurrent_vector.h

Namespace: Concurrency

Community Additions

© 2015 Microsoft