view: ostream operator should print list, not concatenation

This commit is contained in:
Danny Robson 2016-02-10 13:08:02 +11:00
parent e1e5efb357
commit 8e4057cc56

View File

@ -136,6 +136,11 @@ template <typename T>
std::ostream& std::ostream&
util::operator<< (std::ostream &os, util::view<T> v) util::operator<< (std::ostream &os, util::view<T> v)
{ {
std::copy (v.begin (), v.end (), std::ostream_iterator<char> (os)); os << '[';
for (auto &i: v)
os << v << ", ";
os << ']';
return os; return os;
} }