1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-04-09 21:50:45 +01:00

not special characters in std::vector operator<<

This commit is contained in:
Antonin Portelli 2018-04-04 17:44:56 +01:00
parent 85c253ed4a
commit 9ce00f26f9

View File

@ -367,13 +367,13 @@ namespace Grid {
inline std::ostream & operator<<(std::ostream &os, const std::vector<T> &v) inline std::ostream & operator<<(std::ostream &os, const std::vector<T> &v)
{ {
os << "["; os << "[";
for (auto &x: v) for (unsigned int i = 0; i < v.size(); ++i)
{ {
os << x << " "; os << v[i];
} if (i < v.size() - 1)
if (v.size() > 0) {
{ os << " ";
os << "\b"; }
} }
os << "]"; os << "]";