Rename is_leap_second to get_leap_second_info

This commit is contained in:
Howard Hinnant 2019-02-20 15:19:54 -10:00
parent 5a62c405e0
commit 16077472af
2 changed files with 15 additions and 1 deletions

View File

@ -3836,7 +3836,7 @@ public:
CONSTCD11 std::chrono::hours hours() const NOEXCEPT {return h_;} CONSTCD11 std::chrono::hours hours() const NOEXCEPT {return h_;}
CONSTCD11 std::chrono::minutes minutes() const NOEXCEPT {return m_;} CONSTCD11 std::chrono::minutes minutes() const NOEXCEPT {return m_;}
CONSTCD11 std::chrono::seconds seconds() const NOEXCEPT {return s_.seconds();} CONSTCD11 std::chrono::seconds seconds() const NOEXCEPT {return s_.seconds();}
CONSTCD11 std::chrono::seconds& CONSTCD14 std::chrono::seconds&
seconds(detail::undocumented) NOEXCEPT {return s_.seconds();} seconds(detail::undocumented) NOEXCEPT {return s_.seconds();}
CONSTCD11 precision subseconds() const NOEXCEPT {return s_.subseconds();} CONSTCD11 precision subseconds() const NOEXCEPT {return s_.subseconds();}

View File

@ -1922,6 +1922,20 @@ is_leap_second(date::utc_time<Duration> const& ut)
return {ls, ds}; return {ls, ds};
} }
struct get_leap_second_info__t
{
bool is_leap_second;
std::chrono::seconds elapsed;
};
template <class Duration>
get_leap_second_info__t
get_leap_second_info(date::utc_time<Duration> const& ut)
{
auto p = is_leap_second(ut);
return {p.first, p.second};
}
template <class Duration> template <class Duration>
sys_time<typename std::common_type<Duration, std::chrono::seconds>::type> sys_time<typename std::common_type<Duration, std::chrono::seconds>::type>
utc_clock::to_sys(const utc_time<Duration>& ut) utc_clock::to_sys(const utc_time<Duration>& ut)