mirror of
https://github.com/HowardHinnant/date.git
synced 2026-08-03 20:14:08 +02:00
Bring leap_second up to spec
* Adds value() member function.
This commit is contained in:
@@ -7187,6 +7187,7 @@ from_stream(std::basic_istream<CharT, Traits>& is, const CharT* fmt,
|
|||||||
int tp = not_a_ampm;
|
int tp = not_a_ampm;
|
||||||
#if !ONLY_C_LOCALE
|
#if !ONLY_C_LOCALE
|
||||||
tm = std::tm{};
|
tm = std::tm{};
|
||||||
|
tm.tm_isdst = -1;
|
||||||
tm.tm_hour = 1;
|
tm.tm_hour = 1;
|
||||||
ios::iostate err = ios::goodbit;
|
ios::iostate err = ios::goodbit;
|
||||||
f.get(is, nullptr, is, err, &tm, command, fmt+1);
|
f.get(is, nullptr, is, err, &tm, command, fmt+1);
|
||||||
|
|||||||
+2
-1
@@ -1014,7 +1014,8 @@ public:
|
|||||||
DATE_API explicit leap_second(const std::string& s, detail::undocumented);
|
DATE_API explicit leap_second(const std::string& s, detail::undocumented);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
sys_seconds date() const {return date_;}
|
constexpr sys_seconds date() const noexcept {return date_;}
|
||||||
|
constexpr std::chrono::seconds value() const noexcept {return std::chrono::seconds{1};}
|
||||||
|
|
||||||
friend bool operator==(const leap_second& x, const leap_second& y) {return x.date_ == y.date_;}
|
friend bool operator==(const leap_second& x, const leap_second& y) {return x.date_ == y.date_;}
|
||||||
friend bool operator< (const leap_second& x, const leap_second& y) {return x.date_ < y.date_;}
|
friend bool operator< (const leap_second& x, const leap_second& y) {return x.date_ < y.date_;}
|
||||||
|
|||||||
Reference in New Issue
Block a user