C++ attributes: likely, unlikely
From cppreference.com
Allow the compiler to optimize for the case where paths of execution including that statement are more or less likely than any alternative path of execution that does not include such a statement
Syntax
[[likely]] statement
|
(1) | ||||||||
[[unlikely]] statement
|
(2) | ||||||||
Explanation
1) Applies to a statement to allow the compiler to optimize for the case where paths of execution including that statement are more likely than any alternative path of execution that does not include such a statement.
2) Applies to a statement to allow the compiler to optimize for the case where paths of execution including that statement are less likely than any alternative path of execution that does not include such a statement.
Example
This section is incomplete Reason: no example |