• Class / Function / Type

      std::
    • Header file

      <>
    • Other / All

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

    履歴 編集

    function
    <coroutine>

    std::coroutine_handle::コンストラクタ

    constexpr coroutine_handle() noexcept;           // (1)
    constexpr coroutine_handle(nullptr_t) noexcept;  // (2)
    

    概要

    有効なコルーチンを指さないコルーチンハンドルを構築する。

    実際のコルーチンを指すcoroutine_handleは、静的メンバ関数from_promisefrom_addressを利用する。

    事後条件

    address() == nullptr

    例外

    投げない

    #include <cassert>
    #include <coroutine>
    
    int main()
    {
      std::coroutine_handle<> h;
      assert(h.address() == nullptr);
    }
    

    出力

    バージョン

    言語

    • C++20

    処理系

    関連項目