lambda+for_each+delete on STL containers
- by rubenvb
I'm trying to get a simple delete every pointer in my vector/list/... function written with an ultra cool lambda function. Mind you, I don't know c**p about those things :)
template <typename T>
void delete_clear(T const& cont)
{
for_each(T.begin(), T.end(), [](???){ ???->delete() } );
T.clear();
}
I have no clue what to fill in for the ???'s. Any help is greatly appreciated!