Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::noop_coroutine_promise

      From cppreference.com
      <cpp‎ |coroutine
       
       
      Utilities library
       
      Coroutine support
      Coroutine traits
      Coroutine handle
      No-op coroutines
      noop_coroutine_promise
      (C++20)
      Trivial awaitables
      Range generators
      (C++23)
       
      Defined in header<coroutine>
      struct noop_coroutine_promise{};
      (since C++20)

      noop_coroutine_promise is the promise type of no-op coroutines.

      A no-op coroutine behaves as if it

      • does nothing other than the control flow of a coroutine, and
      • is suspended immediately after beginning and resumption, and
      • has a coroutine state such that destroying the state is no-op, and
      • never reaches its final suspended point if there is anystd::coroutine_handle referring to it.
      This section is incomplete
      Reason: more precise wording

      No-op coroutines can be started bystd::noop_coroutine, and controlled by the coroutine handle it returns. The returned coroutine handle is of typestd::noop_coroutine_handle, which is a synonym forstd::coroutine_handle<std::noop_coroutine_promise>.

      Some operations of a no-op coroutines are determined no-op at compile time through the typestd::noop_coroutine_handle.

      This section is incomplete
      Reason: usage of no-op coroutines

      [edit]Example

      This section is incomplete
      Reason: no example

      [edit]See also

      creates a coroutine handle that has no observable effects when resumed or destroyed
      (function)[edit]
      std::coroutine_handle<std::noop_coroutine_promise>, intended to refer to a no-op coroutine
      (typedef)[edit]
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/coroutine/noop_coroutine_promise&oldid=162077"

      [8]ページ先頭

      ©2009-2025 Movatter.jp