Thursday, November 25, 2010

Remove() Algorithm

If you have a vector/list of 5 integers, whose values are all 8, and you call the remove function from the <algorithm> header file, and in that call you specify that you want all elements with the value of 8 removed. The value returned by the vector/list's size() member function will be 5.

Effective STL: 50 Specific Ways to Improve Your Use of the Standard Template Library by Scott Meyers. Addison-Wesley, 2001.
C++ Templates by David Vandevoorde and Nicolai M. Josuttis. Addison-Wesley, 2003

No comments:

Post a Comment