mirror of
https://github.com/ToruNiina/toml11.git
synced 2025-09-19 03:18:09 +08:00
fix: don't ignore std::setw(0)
This commit is contained in:
@@ -484,10 +484,12 @@ template<typename charT, typename traits>
|
|||||||
std::basic_ostream<charT, traits>&
|
std::basic_ostream<charT, traits>&
|
||||||
operator<<(std::basic_ostream<charT, traits>& os, const value& v)
|
operator<<(std::basic_ostream<charT, traits>& os, const value& v)
|
||||||
{
|
{
|
||||||
// get status of std::setw(). if the width is narrower than 5 chars, ignore.
|
// get status of std::setw().
|
||||||
const auto w = os.width();
|
const std::size_t w = os.width();
|
||||||
const auto fprec = os.precision();
|
const int fprec = os.precision();
|
||||||
os << visit(serializer((w > 5 ? w : 80), fprec, false), v);
|
|
||||||
|
// the root object can't be an inline table. so pass `false`.
|
||||||
|
os << visit(serializer(w, fprec, false), v);
|
||||||
return os;
|
return os;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user