|
Boost : |
Subject: Re: [boost] Query of interest for a container output library
From: Klaim - Joël Lamotte (mjklaim_at_[hidden])
Date: 2013-01-30 11:02:18
I think a solution similar to to_string() overloads would be better and
would let the user define it's << operator easily if he wants.
For example
std::cout << to_string(std::vector<int> {1,2,3}) << '\n';
std::cout << to_string(std::set<int> {1,2,3}) << '\n';
std::cout << to_string(std::map<int,int> { {1,2}, {2,3}, {3,1} }) << '\n';
is:
[1,2,3]
{1,2,3}
{(1,2), (2,3), (3,1)}
It could be another function name, but I agree that adding << overloads
might not be the best way to do it.
It makes things more explicit.
Joel Lamotte
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk