Assuming that you don't care about the cost of reallocations, the swap trick a good way to empty a container.
Reference: More Exceptional C++ by Herb Sutter. Addison-Wesley, 2001, p. 52.
Monday, October 18, 2010
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment