T
Tino
In TC++PL (third edition), Section 16.3.8, Stroustrup gives the
following as a way to give memory from a std::vector back to the
system:
vector<int> tmp = v; // v.size() == 0
v.swap( tmp ); // v now has capacity of tmp (default), extra capacity
returned to system
We need to have a general method that returns memory back to the
system for vectors which are no longer needed, but have not yet gone
out of scope. Are there alternative suggestions for accomplishing
this?
Regards,
Ryan
following as a way to give memory from a std::vector back to the
system:
vector<int> tmp = v; // v.size() == 0
v.swap( tmp ); // v now has capacity of tmp (default), extra capacity
returned to system
We need to have a general method that returns memory back to the
system for vectors which are no longer needed, but have not yet gone
out of scope. Are there alternative suggestions for accomplishing
this?
Regards,
Ryan