https://github.com/tx7do/test_cxx20_coroutine
https://github.com/tx7do/test_cxx20_coroutine
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/tx7do/test_cxx20_coroutine
- Owner: tx7do
- License: mit
- Created: 2022-12-16T10:20:13.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-12-16T13:10:30.000Z (over 3 years ago)
- Last Synced: 2025-01-02T05:32:16.879Z (over 1 year ago)
- Language: C++
- Size: 10.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# test_cxx20_coroutine
GCC 10以及以上支持,以下的版本不支持。
需要包含`-fcoroutines`标识符,否则不能使用协程功能。
cmake当中加入标识符有以下方式:
```cmake
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fcoroutines")
add_compile_options( "-fcoroutines")
target_compile_options( PRIVATE "-fcoroutines")
target_add_compile_flags_if_supported( PRIVATE -fcoroutines)
```
## 参考资料
- [Your first coroutine](https://blog.panicsoftware.com/your-first-coroutine/)