I\'m always trying to learn more about the languages I use (different styles, frameworks, patterns, etc). I\'ve noticed that I never use std::for_each so I thought that perh
Boost.Range simplifies the use of standard algorithms. For your example you could write:
boost::for_each(v, [](int n) { cout << n << endl; });
(or boost::copy with an ostream iterator as suggested in other answers).
boost::copy