| D++ (DPP) C++ Discord API Bot Library

Search
Loading...
Searching...
No Matches
Using Coroutines

Warning
  D++ Coroutines are currently only supported by D++ on g++ 13, clang/LLVM 14, and MSVC 19.37 or above. Additionally, your program has to support C++20.

One of the most anticipated features of C++20 is the addition of coroutines: in short, they are functions that can be paused while waiting for data and resumed when that data is ready. They make asynchronous programs much easier to write, but they do come with additional dangers and subtleties.

- Introduction to coroutines
- Making simple commands
- Waiting for events
- Making expiring buttons with when_any

Coroutines require you to use C++20. You can do this by adding

- -std=c++20 in your build command (before specifying files) if building manually, or,
- if using CMake, by adding target_compile_features(my_program PUBLIC cxx_std_20) in your CMakeLists.txt.

If you don't want to use Coroutines, You can either add

- -DDPP_NO_CORO in your build command, or, if using CMake,
- target_compile_definitions(my_program PUBLIC DPP_NO_CORO).
- Additionally, you can build D++ without Coroutines with the same above.

D++ Library version 9.0.13 D++ Library version 9.0.12 D++ Library version 9.0.11 D++ Library version 9.0.10 D++ Library version 9.0.9 D++ Library version 9.0.8 D++ Library version 9.0.7 D++ Library version 9.0.6 D++ Library version 9.0.5 D++ Library version 9.0.4 D++ Library version 9.0.3 D++ Library version 9.0.2 D++ Library version 9.0.1 D++ Library version 9.0.0 D++ Library version 1.0.2 D++ Library version 1.0.1 D++ Library version 1.0.0