forked from HowardHinnant/date
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:
13
date.h
13
date.h
@@ -3455,18 +3455,11 @@ operator<<(std::ostream& os,
|
|||||||
return os << year_month_day(dp) << ' ' << make_time(tp-dp);
|
return os << year_month_day(dp) << ' ' << make_time(tp-dp);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class Duration>
|
|
||||||
inline
|
inline
|
||||||
typename std::enable_if
|
std::ostream&
|
||||||
<
|
operator<<(std::ostream& os, const day_point& dp)
|
||||||
!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)
|
|
||||||
{
|
{
|
||||||
return os << year_month_day(floor<days>(tp));
|
return os << year_month_day(dp);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace date
|
} // namespace date
|
||||||
|
Reference in New Issue
Block a user