From 16775dccb9bad55daee7b3ee3e5efba6c58f9258 Mon Sep 17 00:00:00 2001 From: Howard Hinnant Date: Mon, 3 Aug 2015 22:13:20 -0400 Subject: [PATCH] Remove streaming for time_points with resolution greater... than a day. * cout << floor(system_clock::now()) is very confusing. * The aforementioned streaming operation is now a compile time error. --- date.h | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/date.h b/date.h index 4473d94..073abee 100644 --- a/date.h +++ b/date.h @@ -3455,18 +3455,11 @@ operator<<(std::ostream& os, return os << year_month_day(dp) << ' ' << make_time(tp-dp); } -template inline -typename std::enable_if -< - !std::chrono::treat_as_floating_point::value && - !std::ratio_less::value - , std::ostream& ->::type -operator<<(std::ostream& os, - const std::chrono::time_point& tp) +std::ostream& +operator<<(std::ostream& os, const day_point& dp) { - return os << year_month_day(floor(tp)); + return os << year_month_day(dp); } } // namespace date