
6 Jul
2004
6 Jul
'04
3:53 p.m.
Daniel Frey wrote:
Gennaro Prota wrote:
Does the swap trick necessarily free the memory?
AFAIK, yes. See <http://www.gotw.ca/gotw/054.htm>.
The STL implementation I have been using seems to allocate a buffer on first insertion into any container of a given type, and frees it only when it feels like it (often on program shut-down). I don't know if it's a strictly conforming implementation in that respect, although I can't see anything in the standard prohibiting this behaviour. James Hopkin