Bring leap_second up to spec

* Adds value() member function.
This commit is contained in:
Howard Hinnant
2025-12-01 17:04:25 -05:00
parent a5db3aecec
commit b2e917ce6c
2 changed files with 3 additions and 1 deletions
+1
View File
@@ -7187,6 +7187,7 @@ from_stream(std::basic_istream<CharT, Traits>& is, const CharT* fmt,
int tp = not_a_ampm;
#if !ONLY_C_LOCALE
tm = std::tm{};
tm.tm_isdst = -1;
tm.tm_hour = 1;
ios::iostate err = ios::goodbit;
f.get(is, nullptr, is, err, &tm, command, fmt+1);
+2 -1
View File
@@ -1014,7 +1014,8 @@ public:
DATE_API explicit leap_second(const std::string& s, detail::undocumented);
#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_;}