file
PPBool.hPPBool provides various macros for metaprogramming with conditionals and boolean logic.
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Defines
- #define TRUE
- Macro for logical
true
, used to clarify intent over using1
- #define FALSE
- Macro for logical
false
, used to clarify intent over using0
- #define V_TRUE(...)
- Macro for consuming a variadic argument pack and converting it to
true
- #define V_FALSE(...)
- Macro for consuming a variadic argument pack and converting it to
false
- #define IF_ELSE(condition, true_case, false_case)
- Macro for performing if-else conditional branch in the preprocessor Evaluates condition, and if it is
TRUE
, preprocessing resolves to the token stringtrue_case
. Otherwise, processing resolves to the token stringfalse_case
- #define IF_ELSE_IMPL(condition)
- Implements conditional evaluation for
IF_ELSE
- #define IF_ELSE_0(true_case, false_case)
- Implements false case evaluation for
IF_ELSE
- #define IF_ELSE_1(true_case, false_case)
- Implements true case evaluation for
IF_ELSE
- #define IF(condition, true_case)
- Macro for performing and if conditional branch in the preprocessor Evaluates condition, and if it is
TRUE
, preprocessing resolves to the token stringtrue_case
. Otherwise, processing resolves to no tokens. - #define IF_IMPL(condition)
- Implements conditional evaluation for
IF
- #define IF_0(true_case)
- Implements false case evaluation for
IF
- #define IF_1(true_case)
- Implements true case evaluation for
IF
- #define NOT(x)
- Macro for performing logical not (e.g.
!
) in the preprocessor Evaluatesx
, and if it isTRUE
, preprocessing resolves toFALSE
Otherwise, processing resolves toTRUE
- #define NOT_IMPL(x)
- Implements conditional evaluation for
NOT
- #define NOT_0
- Implements false case evaluation for
NOT
- #define NOT_1
- Implements true case evaluation for
NOT
- #define OR(x, y)
- Macro for performing logical or (e.g.
||
) in the preprocessor Evaluatesx
andy
, and if either areTRUE
, preprocessing resolves toTRUE
. Otherwise, preprocessing resolves toFALSE
- #define OR_IMPL(x, y)
- Implements conditional evaluation for
OR
- #define OR_IMPL_0_0
- Implements conditional evaluation for
OR
- #define OR_IMPL_0_1
- Implements conditional evaluation for
OR
- #define OR_IMPL_1_0
- Implements conditional evaluation for
OR
- #define OR_IMPL_1_1
- Implements conditional evaluation for
OR
- #define AND(x, y)
- Macro for performing logical and (e.g.
&&
) in the preprocessor Evaluatesx
andy
, and if both areTRUE
, preprocessing resolves toTRUE
. Otherwise, preprocessing resolves toFALSE
- #define AND_IMPL(x, y)
- Implements conditional evaluation for
AND
- #define AND_IMPL_0_0
- Implements conditional evaluation for
AND
- #define AND_IMPL_0_1
- Implements conditional evaluation for
AND
- #define AND_IMPL_1_0
- Implements conditional evaluation for
AND
- #define AND_IMPL_1_1
- Implements conditional evaluation for
AND