I have a std::list
of Bananas
, and I want to get rid of the bad ones. Is there any relatively simple way to perform the following pseudocode?
foreach(Banana banana in bananaList)
{
if(banana.isBad()) bananaList.remove(banana);
}
(Making a transition from C# and Java to C++ has been a rocky road.)