Compile-time for each loop. More...
Go to the source code of this file.
Namespaces | |
| namespace | bbm |
Concepts | |
| concept | bbm::has_constforeach_lambda |
| Concept to check if a lambda functions meets the required signature. | |
Macros | |
| #define | CONSTFOREACH(ITR_TYPE, TYPE_LIST, ...) if constexpr (sizeof...(TYPE_LIST) > 0) bbm::constforeach<TYPE_LIST...>( [&]<typename ITR_TYPE>() { __VA_ARGS__ } ); |
| HELPER MACRO. | |
Functions | |
| template<typename... T, typename F > requires has_constforeach_lambda<F, T...> | |
| constexpr void | constforeach (F &&f) |
| constforeach over all typenames in T. | |
Compile-time for each loop.
Expects the body to passed as a templated lambda that takes the typenames and no arguments.
Example:
Prints the typestrings of all typenames in Ts.
A helper macro simplifies the call:
| #define CONSTFOREACH | ( | ITR_TYPE, | |
| TYPE_LIST, | |||
| ... | |||
| ) | if constexpr (sizeof...(TYPE_LIST) > 0) bbm::constforeach<TYPE_LIST...>( [&]<typename ITR_TYPE>() { __VA_ARGS__ } ); |
HELPER MACRO.