问题
It seems like the clang compiler flags are currently not compatible with the gnu standard library. Is there still a way to use coroutines?
回答1:
It's not quite accurate to say that GCC's header requires -fcoroutines
, what it actually requires is for the __cpp_impl_coroutine
macro to be defined by the compiler, indicating that the compiler supports C++20 Coroutines. With GCC, you activate that support by using -fcoroutines
.
来源:https://stackoverflow.com/questions/64525567/clang-gnu-standard-library-requires-fcoroutines-but-clang-only-supports-fcoro