Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
We recommend using Visual Studio 2017

concurrent_vector::shrink_to_fit Method

Compacts the internal representation of the concurrent vector to reduce fragmentation and optimize memory usage.

template<
   typename _Ty,
   class _Ax
>
void concurrent_vector<_Ty, _Ax>::shrink_to_fit();

This method will internally re-allocate memory move elements around, invalidating all the iterators. shrink_to_fit is not concurrency-safe. You must ensure that no other threads are invoking methods on the concurrent vector when you call this function.

Header: concurrent_vector.h

Namespace: Concurrency

Community Additions

Show:
© 2018 Microsoft