Difference between revisions of "Cpp Coding Standards/STL/EraseMem"
From Apache OpenOffice Wiki
< Cpp Coding Standards | STL
m (Cpp Coding Standards/The Cpp Standard Template Library/EraseMem moved to Cpp Coding Standards/STL/EraseMem: consistency) |
m |
||
Line 1: | Line 1: | ||
Use this idiom to actually release all memory claimed by an STL container: | Use this idiom to actually release all memory claimed by an STL container: | ||
− | + | ||
− | container<T>().swap(myContainer); | + | container<T>().swap(myContainer); |
− | + |
Revision as of 18:59, 22 May 2007
Use this idiom to actually release all memory claimed by an STL container:
container<T>().swap(myContainer);