c++ - Is it possible to co_await in a catch clause?
问题描述
The following code:
try {
throw 42;
} catch (int i) {
co_await somefuture;
}
compiles with clang 6 and 7 with -fcoroutines-ts. However, it does not compile with Visual C++ 15 (2017) Visual C++ 16 (2019) with /await with the error
C2304: 'co_await' cannot be used inside of a catch block
The C++20 standard draft and cppreference do not seem to mention anything about it.
Is it a missing feature in the Microsoft compiler or did I misunderstand the standard?
解决方案
推荐阅读
- javascript - 将子节点传递给功能性反应组件编写的打字稿
- ruby-on-rails-6 - 有没有办法通过表单访问多对多 ActiveRecord 关联中的单个元素?
- sql - Linq2DB 无法翻译 Where 子句中的映射列
- javascript - 带有时间标签 xAxes 的 Charts.js
- python - 如何在应用 lambda 函数中对 if else 不做任何事情?
- ios - #warning "FirebaseAnalytics.framework 未包含在您的目标中
- java - 通过 WebFlux 客户端获取不同的错误 DTO
- java - 在 Spark Java 中通过 Websocket 发送消息
- python - 有没有办法选择在二元粒子群优化中选择多少个特征?
- laravel - JwtAuth 没有在 Backpack Laravel 中生成令牌