std::chrono::month_day_last::ok
constexpr bool ok() const noexcept; | (начиная с C++20) |
Проверяет, является ли объект month, хранящийся в *this, допустимым.
Возвращаемое значение
month().ok()
Пример
#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());
}
© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://en.cppreference.com/cpp/chrono/month_day_last/ok