mirror of
https://github.com/HowardHinnant/date.git
synced 2024-12-27 00:14:07 +08:00
Rename is_leap_second to get_leap_second_info
This commit is contained in:
parent
5a62c405e0
commit
16077472af
@ -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();}
|
||||||
|
|
||||||
|
@ -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)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user