Skip to content

Latest commit

 

History

History
51 lines (39 loc) · 1.24 KB

File metadata and controls

51 lines (39 loc) · 1.24 KB

ok

  • chrono[meta header]
  • std::chrono[meta namespace]
  • month_weekday[meta class]
  • function[meta id-type]
  • cpp20[meta cpp]
constexpr bool ok() const noexcept; // (1) C++20

概要

month_weekdayオブジェクトの値が有効な日付の範囲内かを判定する。

戻り値

以下の全ての条件を満たす場合にこの関数はtrueを返し、そうでなければfalseを返す:

#include <cassert>
#include <chrono>

namespace chrono = std::chrono;

int main()
{
  assert((chrono::March/chrono::Sunday[1]).ok()  == true);
  assert((chrono::March/chrono::Sunday[0]).ok()  == false);
}
  • ok()[color ff0000]
  • chrono::March[link /reference/chrono/month_constants.md]
  • chrono::Sunday[link /reference/chrono/weekday_constants.md]

出力

バージョン

言語

  • C++20

処理系

  • Clang: 8.0 [mark verified]
  • GCC: 11.1 [mark verified]
  • Visual C++: 2019 Update 3 [mark noimpl]