• Class / Function / Type

      std::
    • Header file

      <>
    • Other / All

    最終更新日時(UTC):
    が更新

    履歴 編集

    function
    <chrono>

    std::chrono::weekday_indexed::weekday

    constexpr chrono::weekday weekday() const noexcept; // (1) C++20
    

    概要

    曜日を取得する。

    戻り値

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

    #include <cassert>
    #include <chrono>
    
    namespace chrono = std::chrono;
    
    int main()
    {
      chrono::weekday_indexed wi = chrono::Sunday[1];
      chrono::weekday w = wi.weekday();
    
      assert(w == chrono::Sunday);
    }
    

    出力

    バージョン

    言語

    • C++20

    処理系