Skip to content

Latest commit

 

History

History
52 lines (40 loc) · 1.07 KB

month.md

File metadata and controls

52 lines (40 loc) · 1.07 KB

month

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

概要

月要素を取得する。

戻り値

コンストラクタで設定されて保持している月オブジェクトを返す。

#include <cassert>
#include <chrono>

namespace chrono = std::chrono;

int main()
{
  chrono::month_weekday mwd = chrono::March/chrono::Sunday[1];

  chrono::month m = mwd.month();
  assert(m == chrono::March);
}
  • mwd.month()[color ff0000]
  • chrono::month[link /reference/chrono/month.md]
  • 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]