logoalt Hacker News

reddit_cloneyesterday at 11:08 PM2 repliesview on HN

Talking about un-guessable, misleading function names,

C++ std::remove.

I would never have guessed what it does exactly. (It moves elements that match the filter to the front, and moves the end-marker forward. Leaves all the elements in the collection. You need to erase them yourself. )


Replies

mitxelayesterday at 11:53 PM

It returns the new end marker

anitilyesterday at 11:54 PM

Oh it's a bit like unordered-delete when using an arena. I guess I would have expected an ordered-delete instead