diff --git a/include/toml11/serializer.hpp b/include/toml11/serializer.hpp index 318f763..a790613 100644 --- a/include/toml11/serializer.hpp +++ b/include/toml11/serializer.hpp @@ -1201,6 +1201,13 @@ std::string format(const std::vector::key_type>& ks, return ser(ks, v); } +template +std::ostream& operator<<(std::ostream& os, const basic_value& v) +{ + os << format(v); + return os; +} + } // toml #if defined(TOML11_COMPILE_SOURCES) diff --git a/tests/utility.hpp b/tests/utility.hpp index a4df9b2..06c05e9 100644 --- a/tests/utility.hpp +++ b/tests/utility.hpp @@ -86,13 +86,6 @@ void toml11_test_parse_failure(F fn, std::string in, toml::detail::context c namespace toml { -template -std::ostream& operator<<(std::ostream& os, const toml::basic_value& v) -{ - os << toml::format(v); - return os; -} - std::ostream& operator<<(std::ostream& os, const integer_format_info&); std::ostream& operator<<(std::ostream& os, const floating_format_info&); std::ostream& operator<<(std::ostream& os, const string_format_info&);