mirror of
https://github.com/HowardHinnant/date.git
synced 2025-01-14 01:37:57 +08:00
Remove streaming for time_points with resolution greater...
than a day. * cout << floor<years>(system_clock::now()) is very confusing. * The aforementioned streaming operation is now a compile time error.
This commit is contained in:
parent
94237ceaa7
commit
16775dccb9
13
date.h
13
date.h
@ -3455,18 +3455,11 @@ operator<<(std::ostream& os,
|
||||
return os << year_month_day(dp) << ' ' << make_time(tp-dp);
|
||||
}
|
||||
|
||||
template <class Duration>
|
||||
inline
|
||||
typename std::enable_if
|
||||
<
|
||||
!std::chrono::treat_as_floating_point<typename Duration::rep>::value &&
|
||||
!std::ratio_less<typename Duration::period, days::period>::value
|
||||
, std::ostream&
|
||||
>::type
|
||||
operator<<(std::ostream& os,
|
||||
const std::chrono::time_point<std::chrono::system_clock, Duration>& tp)
|
||||
std::ostream&
|
||||
operator<<(std::ostream& os, const day_point& dp)
|
||||
{
|
||||
return os << year_month_day(floor<days>(tp));
|
||||
return os << year_month_day(dp);
|
||||
}
|
||||
|
||||
} // namespace date
|
||||
|
Loading…
x
Reference in New Issue
Block a user