c++ - Will the macro `assert` be removed in C++20?
问题描述
According to cppreference, assert
will be used as a C++ attribute.
However, there already exist tons of projects heavily dependent on the macro assert
, is there any bad effect?
解决方案
不。引入 C++20 合约的提案p0542r5说:
请注意,虽然
assert(expression)
将扩展为具有适当标头的类似函数的宏,但assert:
不是类似函数的调用,因此不会展开。
推荐阅读
- php - 无法使用 php 将 SQL 数据迭代到 html 表“td”而不会变得一团糟
- cuda - 需要帮助使用嵌套迭代器 transform_reduce 操作优化推力 cuda 代码
- postgresql - 通过 Unix 套接字将 DBeaver 连接到远程 PostgreSQL DB
- c++ - 如何将字符串添加到杜鹃过滤器?
- python - Azure Blobstore:如何在无需先下载整个文件的情况下读取文件?
- google-cloud-platform - 由于 CPU 使用率高,Cloud Run 503 错误
- php - 从用户端请求输入
- ios - 如何在uitextfield或按钮之外点击退出键盘
- python-3.x - API调用类:如何正确处理令牌
- android - 是否可以使用 Appium 运行 Android 仪器测试?