diff --git a/toml/serializer.hpp b/toml/serializer.hpp index 248018b..3854ead 100644 --- a/toml/serializer.hpp +++ b/toml/serializer.hpp @@ -510,6 +510,18 @@ operator<<(std::basic_ostream& os, const value& v) os << visit(serializer(w, fprec, false), v); return os; } +template +std::basic_ostream& +operator<<(std::basic_ostream& os, const table& v) +{ + // get status of std::setw(). + const std::size_t w = os.width(); + const int fprec = os.precision(); + os.width(0); + // the root object can't be an inline table. so pass `false`. + os << serializer(w, fprec, false)(v); + return os; +} } // toml #endif// TOML11_SERIALIZER_HPP