I think this should be:
```C++
for (auto iter=container->begin(); iter != container->end(); ++iter) {
    std::cout << (*iter)->name() << std::endl;
}
```