fix: reset stream width before printing

without this, the first line of the serialized result becomes too wide
This commit is contained in:
ToruNiina
2019-02-16 23:55:19 +09:00
parent d7b8c3c78f
commit 2dd0a78c52

View File

@@ -501,7 +501,7 @@ operator<<(std::basic_ostream<charT, traits>& os, const value& v)
// get status of std::setw(). // get status of std::setw().
const std::size_t w = os.width(); const std::size_t w = os.width();
const int fprec = os.precision(); const int fprec = os.precision();
os.width(0);
// the root object can't be an inline table. so pass `false`. // the root object can't be an inline table. so pass `false`.
os << visit(serializer(w, fprec, false), v); os << visit(serializer(w, fprec, false), v);
return os; return os;