std::chrono::year_month_day_last:: ok
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Member functions | ||||
|
year_month_day_last::ok
|
||||
| Nonmember functions | ||||
| Helper classes | ||||
|
constexpr
bool
ok
(
)
const
noexcept
;
|
(seit C++20) | |
Prüft, ob
*
this
ein gültiges Datum repräsentiert. Da ein
year_month_day_last
den letzten Tag eines bestimmten Monats darstellt, repräsentiert es ein gültiges Datum, solange Jahr und Monat gültig sind.
Rückgabewert
year ( ) . ok ( ) && month ( ) . ok ( )
Beispiel
#include <cassert> #include <chrono> int main() { auto ymdl{std::chrono::last/11/2020}; assert(ymdl.ok()); ymdl = std::chrono::year(2020)/std::chrono::month(13)/std::chrono::last; assert(not ymdl.ok()); }