diff --git a/include/date/date.h b/include/date/date.h index daafc98..28f4df0 100644 --- a/include/date/date.h +++ b/include/date/date.h @@ -1020,6 +1020,7 @@ protected: std::basic_ios& is_; CharT fill_; std::ios::fmtflags flags_; + std::streamsize precision_; std::streamsize width_; std::basic_ostream* tie_; std::locale loc_; @@ -1029,6 +1030,7 @@ public: { is_.fill(fill_); is_.flags(flags_); + is_.precision(precision_); is_.width(width_); is_.imbue(loc_); is_.tie(tie_); @@ -1041,6 +1043,7 @@ public: : is_(is) , fill_(is.fill()) , flags_(is.flags()) + , precision_(is.precision()) , width_(is.width(0)) , tie_(is.tie(nullptr)) , loc_(is.getloc()) @@ -3997,6 +4000,7 @@ public: std::chrono::duration d = s_ + sub_s_; if (d < std::chrono::seconds{10}) os << '0'; + os.precision(width+6); os << std::fixed << d.count(); return os; } @@ -4187,9 +4191,7 @@ make24(std::chrono::hours h, bool is_pm) NOEXCEPT template using time_of_day = hh_mm_ss; -template ::value>::type> +template CONSTCD11 inline hh_mm_ss> @@ -4202,8 +4204,7 @@ template inline typename std::enable_if < - !std::chrono::treat_as_floating_point::value && - std::ratio_less::value + std::ratio_less::value , std::basic_ostream& >::type operator<<(std::basic_ostream& os, const sys_time& tp)