
30 Jan
2013
30 Jan
'13
4:02 p.m.
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