以下成员源于类 <QtAssert> 被弃用。 提供它们是为使旧源代码能继续工作。强烈建议不要在新代码中使用它们。
(弃用)
void
|
Q_ASSUME (bool expr ) |
[deprecated]
void
Q_ASSUME
(
bool
expr
)
This macro is deprecated. We strongly advise against using it in new code.
Causes the compiler to assume that
expr
is
true
.
This macro is known to produce worse code than when no assumption was inserted in the code, with some compiler versions. The arguments passed to it are always evaluated, even in release mode, with some compilers and not others, so application code needs to be aware of those possible differences in behavior.
Do not use it in new code. It is retained as-is for compatibility with old code and will likely be removed in the next major version Qt.
另请参阅 Q_ASSERT (), Q_UNREACHABLE (),和 Q_LIKELY ().