std::for_each in is incredibly well suited for this, some compilers are now picking up lambdas from C++0x which makes this even more intuitive.
typedef std::list<MyClass*> MyClassList;
MyClassList l;
for_each(l.begin(),l.end(),[](MyClass* cur)
{
cur->PrintMeOut();
});
for_each (and the rest of the algorithms) help mask the abstraction between the iterators and types. Also note that now I have this little tiny lambda function (or it could be a functor too) which is more testable, mockable, replacable etc.
If I go back to not using lambdas I can build a stand along method to do this, which is testable:
void PrintMyClass(MyClass* cur)
{
cur->PrintMeOut();
}
and the for_each code now looks like this:
typedef std::list<MyClass*> MyClassList;
MyClassList l;
for_each(l.begin(),l.end(),&PrintMyClass);