std::chrono::month_day_last::ok
Von cppreference.com
< cpp | chrono | month day last
| constexpr bool ok() const noexcept; |
(seit C++20) | |
Prüft, ob das im Objekt *this gespeicherte month gültig ist.
[bearbeiten] Rückgabewert
month().ok()
[bearbeiten] Beispiel
Führen Sie diesen Code aus
#include <cassert> #include <chrono> int main() { auto mdl{std::chrono::February/std::chrono::last}; assert(mdl.ok()); mdl = {std::chrono::month(42)/std::chrono::last}; assert(!mdl.ok()); }