Boost logo

Boost Users :

From: me22 (me22.ca_at_[hidden])
Date: 2005-03-04 19:49:33


On Fri, 04 Mar 2005 16:59:12 -0500, Jason House <jhouse_at_[hidden]> wrote:
> "In a nutshell" one can do the following:
> for_each(a.begin(), a.end(), std::cout << _1 << ' ');
>
> (where a is something like std::list<int>)

You can cout the contents of container a with spaces between using:
copy( a.begin(), a.end(), ostream_iterator< a::value_type >( cout, ' ' ) );

No boost required. Hopefully someone with more boost experience can
give an elegant solution for a more general case ( such as your map<
string, list<int> > ).

- Scott McMurray


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net