- chrono[meta header]
- std::chrono[meta namespace]
- weekday_last[meta class]
- function[meta id-type]
- cpp20[meta cpp]
constexpr bool ok() const noexcept; // (1) C++20weekday_lastオブジェクトが保持する曜日が妥当な範囲内にあるかを判定する。
コンストラクタで設定されて保持している曜日を表す値wd_があるとして、以下を返す:
return wd_.ok();- wd_.ok()[link /reference/chrono/weekday/ok.md]
#include <cassert>
#include <chrono>
namespace chrono = std::chrono;
int main()
{
assert(chrono::Sunday[chrono::last].ok());
assert(!(chrono::weekday_last{chrono::weekday{8}}).ok());
}- ok()[color ff0000]
- chrono::Sunday[link /reference/chrono/weekday_constants.md]
- chrono::weekday[link /reference/chrono/weekday.md]
- chrono::last[link /reference/chrono/last_spec.md]
- C++20
- Clang: 8.0 [mark verified]
- GCC: 9.2 [mark noimpl]
- Visual C++: 2019 Update 3 [mark noimpl]