lang:gnu标准库需要-fcoroutines,但clang仅支持-fcoroutines-ts [英] Clang: gnu standard library requires -fcoroutines but clang only supports -fcoroutines-ts

查看:66
本文介绍了lang:gnu标准库需要-fcoroutines,但clang仅支持-fcoroutines-ts的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

似乎clang编译器标志当前与gnu标准库不兼容.还有使用协程的方法吗?

It seems like the clang compiler flags are currently not compatible with the gnu standard library. Is there still a way to use coroutines?

推荐答案

说GCC的标头需要 -fcoroutines 并不是很准确,实际上,它是 __ cpp_impl_coroutine 宏,由编译器定义,指示编译器支持C ++ 20协程.使用GCC,您可以使用 -fcoroutines 激活该支持.

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.

这篇关于lang:gnu标准库需要-fcoroutines,但clang仅支持-fcoroutines-ts的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆