include/Cnx/mpl/PPBool.h file

PPBool 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 using 1
#define FALSE
Macro for logical false, used to clarify intent over using 0
#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 string true_case. Otherwise, processing resolves to the token string false_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 string true_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 Evaluates x, and if it is TRUE, preprocessing resolves to FALSE Otherwise, processing resolves to TRUE
#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 Evaluates x and y, and if either are TRUE, preprocessing resolves to TRUE. Otherwise, preprocessing resolves to FALSE
#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 Evaluates x and y, and if both are TRUE, preprocessing resolves to TRUE. Otherwise, preprocessing resolves to FALSE
#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