std::suspend_never(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

✨ std::suspend_never ✨

okay bestie, this is the C++ Standard Libary manual page for std::suspend_never β€” yes, manual name folded in right at the top, exactly as requested πŸ’….


πŸŽ€ NAME πŸŽ€

std::suspend_never - std::suspend_never

The NAME section is literally that exact pair, no extra garnish needed. iconic πŸ’–

🌈 Synopsis 🌈

Defined in header <coroutine>

struct suspend_never;

(since C++20)

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

🧚 Member functions 🧚

  • await_ready β€” indicates that an await expression never suspends (C++20) (public member function)
  • await_suspend β€” no-op (C++20) (public member function)
  • await_resume β€” no-op (C++20) (public member function)

std::suspend_never::await_ready

constexpr bool await_ready() const noexcept { return true; }

(since C++20)

Always returns true, indicating that an await expression never suspends.

std::suspend_never::await_suspend

constexpr void await_suspend( std::coroutine_handle<> ) const noexcept {}

(since C++20)

Does nothing.

std::suspend_never::await_resume

constexpr void await_resume() const noexcept {}

(since C++20)

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

πŸ¦‹ Example πŸ¦‹

This section is incomplete.

Reason: no example.

πŸ‘‘ See also πŸ‘‘

suspend_always indicates that an await-expression should always suspend (C++20) (class)

πŸ“ Category: πŸ“

  • Todo no example

mwah πŸ’‹ source: http://cppreference.com Β· version/date: 2024.06.10 Β· page: std::suspend_never(3) β€” byeee bestie 🫢✨

πŸ“¦ where this page comes from