Obsolete Members for <QtAssert>
类<QtAssert> 的以下成员已被弃用。提供这些成员是为了保持旧源代码的正常运行。我们强烈建议不要在新代码中使用它们。
宏
(deprecated) void | Q_ASSUME(bool expr) |
宏文档
[deprecated]
void Q_ASSUME(bool expr)
该宏已被弃用。我们强烈建议不要在新代码中使用它。
使编译器假定expr 是true
。
众所周知,在某些版本的编译器中,该宏产生的代码比未插入假设的代码更差。在某些编译器版本中,传给该宏的参数总是要进行评估,即使在发布模式下也是如此,因此应用代码需要注意这些可能的行为差异。
请勿在新代码中使用该参数。保留原样是为了与旧代码兼容,并可能在下一个主要 Qt 版本中删除。
另请参阅 Q_ASSERT()、Q_UNREACHABLE() 和Q_LIKELY()。
© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.