Ben Chuanlong Du's Blog

It is never too late to learn.

Erase Elements of a Container Using Iterator in C++

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

@TODO: make a general discuss about removing elements form containers ...

vector -> best to remove backwards ...

You cannot erase elements from a container using the function std::for_each or the range-based for …