c++/winrt coroutine包括混乱
我正在尝试关注此对于C ++/Winrt,我正在使用Universal C Runtime Clang推荐用于MSYS2 在这里。我正在使用Windows SDK 10.0.22621.0(目前最新的Windows 10最新目前可用于Windows 10)。 我正在遇到包括Coroutine头文件的错误,并正在寻求澄清。在“ Windows套件/10/include/inclate/incepty/cyper/cppwinrt/winrt/base.h”文件
#ifdef __cpp_lib_coroutine // not defined at this point because not included yet
#include <coroutine> // so this include doesn't happen...?
// This is my question, under what condition is this #ifdef block supposed to trigger?
// Because it should and it isn't.
namespace winrt::impl
{
template <typename T = void>
using coroutine_handle = std::coroutine_handle<T>;
using suspend_always = std::suspend_always;
using suspend_never = std::suspend_never;
}
#else
// and instead this include happens, which is incorrect because coroutine is not
// experimental as of early 2019 (https://en.cppreference.com/w/cpp/utility/feature_test)
// https://en.cppreference.com/w/cpp/header/coroutine
#include <experimental/coroutine>
namespace winrt::impl
{
template <typename T = void>
using coroutine_handle = std::experimental::coroutine_handle<T>;
using suspend_always = std::experimental::suspend_always;
using suspend_never = std::experimental::suspend_never;
}
#endif
中菜鸟问题有一个简单的答案,但是我一直在为此挣扎了几个小时,感谢您的任何见解。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论