Talk:Erase–remove idiom

Latest comment: 3 years ago by Macrakis in topic Notability


When the first element to be removed is encountered, all subsequent elements are moved forward by one element, leaving a moved-from element at the end; when the second element to be removed is encountered, subsequent elements are again moved forward by one element; and so on and so forth.

The point of erase-remove is to avoid all this shifting/moving. Have a look at the implementation before undoing again.

Yes, you are right. Sorry I did not see this the first time. But please provide an edit comment the next time you remove content from an article. Thanks. – Tea2min (talk) 20:27, 7 August 2019 (UTC)Reply

Notability edit

This technique is very specific to the C++ library, and reads a lot like how-to advice, and sure enough, the main sources for it are a book entitled Effective STL and other sources of advice for users. It seems to me that it would be more suitable as part of a Wikibooks article on C++ programming than in Wikipedia. --Macrakis (talk) 16:28, 16 March 2021 (UTC)Reply