Difference between revisions of "Cpp Coding Standards/STL/EraseMem"

From Apache OpenOffice Wiki
Jump to: navigation, search
 
 
(2 intermediate revisions by one other user not shown)
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:
<pre>
+
 
container<T>().swap(myContainer);
+
container<T>().swap(myContainer);
</pre>
+
[[Category:Coding Standards]]

Latest revision as of 17:14, 14 December 2009

Use this idiom to actually release all memory claimed by an STL container:

container<T>().swap(myContainer);
Personal tools