From 16077472af2f7167101b50849326ac5fff891c00 Mon Sep 17 00:00:00 2001 From: Howard Hinnant Date: Wed, 20 Feb 2019 15:19:54 -1000 Subject: [PATCH] Rename is_leap_second to get_leap_second_info --- include/date/date.h | 2 +- include/date/tz.h | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/include/date/date.h b/include/date/date.h index a7e0849..92cc773 100644 --- a/include/date/date.h +++ b/include/date/date.h @@ -3836,7 +3836,7 @@ public: CONSTCD11 std::chrono::hours hours() const NOEXCEPT {return h_;} CONSTCD11 std::chrono::minutes minutes() const NOEXCEPT {return m_;} 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();} CONSTCD11 precision subseconds() const NOEXCEPT {return s_.subseconds();} diff --git a/include/date/tz.h b/include/date/tz.h index 7294076..a02ce8c 100644 --- a/include/date/tz.h +++ b/include/date/tz.h @@ -1922,6 +1922,20 @@ is_leap_second(date::utc_time const& ut) return {ls, ds}; } +struct get_leap_second_info__t +{ + bool is_leap_second; + std::chrono::seconds elapsed; +}; + +template +get_leap_second_info__t +get_leap_second_info(date::utc_time const& ut) +{ + auto p = is_leap_second(ut); + return {p.first, p.second}; +} + template sys_time::type> utc_clock::to_sys(const utc_time& ut)