Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::suspend_always

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

      suspend_always is an empty class which can be used to indicate that anawait expression always suspends and does not produce a value.

      Contents

      [edit]Member functions

      await_ready
      indicates that an await expression always suspends
      (public member function)
      await_suspend
      no-op
      (public member function)
      await_resume
      no-op
      (public member function)

      std::suspend_always::await_ready

      constexprbool await_ready()constnoexcept{returnfalse;}

      Always returnsfalse, indicating that an await expression always suspends.

      std::suspend_always::await_suspend

      constexprvoid await_suspend(std::coroutine_handle<>)constnoexcept{}

      Does nothing.

      std::suspend_always::await_resume

      constexprvoid await_resume()constnoexcept{}

      Does nothing. An await expression does not produce a value ifsuspend_always is used.

      [edit]Example

      This section is incomplete
      Reason: no example

      [edit]See also

      indicates that an await-expression should never suspend
      (class)[edit]
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/coroutine/suspend_always&oldid=177347"

      [8]ページ先頭

      ©2009-2025 Movatter.jp