![]() |
Arene Base
Fundamental Utilities For Safety Critical C++
|
Arene Base provides a helper for marking that a boolean expression is expected to be true most of the time. The public header is:
The ARENE_EXPECT macro takes a boolean expression as an argument, which is expected to be true most of the time. This expectation is passed to the compiler, so that it may use that information for code generation and optimization.
For example, in the following code, the optional_configuration parameter to the function foo is not expected to be set very often, so most calls will have an empty optional. ARENE_EXPECT is used to convey that expectation to the compiler.