Quite often (right now actually), I have to do this...
I would like to use for_each for snippets like this, but can't figure out the syntax. Something like this?Code:std::container::const_iterator ci; for (ci = my_container.begin(); ci != my_container.end(); ++ci) { std::cout << *ci; }
Code:std::for_each( my_container.begin(); my_container.end(); std::cout.operator<<() );