|
Boost : |
From: Howard Hinnant (hinnant_at_[hidden])
Date: 2003-10-05 09:35:51
On Oct 5, 2003, at 10:07 AM, Maxim Egorushkin wrote:
> But I wonder, would it be more simple to define
>
> ostream& operator<<(ostream&, const the_map::value_type&);
>
> and print a map using
>
> copy(m.begin(), m.end(), ostream_iterator<the_map::value_type>(cout,
> "\n"));
One easy way to do this would be to modify tuple I/O as described in:
http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/papers/2002/n1403.pdf
to operate on tuple-like types instead of just tuple types. Then once
tuple is standardized (and put in namespace std), then I/O would just
work for std::pair, and enjoy all the benefits of the tuple I/O
manipulators.
-Howard
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk