Add wxVector::shrink_to_fit() for C++11 compatibility
Also use this for wxArray::Shrink() implementation as it's more efficient than the old swap-based implementation which requires an extra memory allocation instead of really shrinking the existing one.
This commit is contained in:
@@ -262,6 +262,18 @@ public:
|
||||
void resize(size_type n, const value_type& v);
|
||||
//@}
|
||||
|
||||
/**
|
||||
Free unused memory allocated by the vector.
|
||||
|
||||
Reduces the memory used by the vector to the bare minimum required to
|
||||
hold its current number of elements, possibly 0.
|
||||
|
||||
After calling this method, capacity() returns the same as size().
|
||||
|
||||
@since 3.1.1
|
||||
*/
|
||||
void shrink_to_fit();
|
||||
|
||||
/**
|
||||
Returns the size of the vector.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user