diff options
Diffstat (limited to 'src/libs')
-rw-r--r-- | src/libs/utils/smallstringio.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/libs/utils/smallstringio.h b/src/libs/utils/smallstringio.h index 10efd06627..6e9e2a7bc2 100644 --- a/src/libs/utils/smallstringio.h +++ b/src/libs/utils/smallstringio.h @@ -32,6 +32,7 @@ #include <iterator> #include <ostream> +#include <sstream> namespace Utils { @@ -232,7 +233,19 @@ ostream &operator<<(ostream &out, const vector<T> &vector) { out << "["; - copy(vector.cbegin(), vector.cend(), ostream_iterator<T>(out, ", ")); + for (auto current = vector.begin(); current != vector.end(); ++current) { + std::ostringstream entryStream; + entryStream << *current; + std::string entryString = entryStream.str(); + + if (entryString.size() > 4) + out << "\n\t"; + + out << entryString; + + if (std::next(current) != vector.end()) + out << ", "; + } out << "]"; |