Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::suspend_never

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

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

      Contents

      [edit]Member functions

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

      std::suspend_never::await_ready

      constexprbool await_ready()constnoexcept{returntrue;}

      Always returnstrue, indicating that an await expression never suspends.

      std::suspend_never::await_suspend

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

      Does nothing.

      std::suspend_never::await_resume

      constexprvoid await_resume()constnoexcept{}

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

      [edit]Example

      This section is incomplete
      Reason: no example

      [edit]See also

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

      [8]ページ先頭

      ©2009-2025 Movatter.jp