D
Dylan
At the moment I often find myself doing something like the following
std::list<MyClass*> mcl;
/.../fill mcl with some elements
//now call aMethod() for each element;
for (std::list<MyClass*>::iterator it = mcl.begin();
it != mcl.end();
++it)
{
it->aMethod();
}
Is there a *convenient* way of using something like std::for_each to
achieve the same result as the loop shown in the previous code
snippet?
thanks
std::list<MyClass*> mcl;
/.../fill mcl with some elements
//now call aMethod() for each element;
for (std::list<MyClass*>::iterator it = mcl.begin();
it != mcl.end();
++it)
{
it->aMethod();
}
Is there a *convenient* way of using something like std::for_each to
achieve the same result as the loop shown in the previous code
snippet?
thanks