diff --git a/chrono_io.h b/chrono_io.h index f08650f..15ab051 100644 --- a/chrono_io.h +++ b/chrono_io.h @@ -129,6 +129,16 @@ operator+(const string_literal& x, const string_literal& string_literal{y}}; } +template +inline +std::basic_string +operator+(std::basic_string x, + const string_literal& y) noexcept +{ + x.append(y.data(), y.size()); + return x; +} + template constexpr inline @@ -658,9 +668,8 @@ std::basic_ostream& operator<<(std::basic_ostream& os, const std::chrono::duration& d) { - using namespace std::chrono; - return os << d.count() - << detail::get_units(typename Period::type{}); + using namespace std; + return os << to_string(d.count()) + detail::get_units(typename Period::type{}); } } // namespace date