13#define ENUM_CASE(name) \
17#define EXPAND(arg) EXPAND1(EXPAND1(EXPAND1(EXPAND1(arg))))
18#define EXPAND1(arg) EXPAND2(EXPAND2(EXPAND2(EXPAND2(arg))))
19#define EXPAND2(arg) EXPAND3(EXPAND3(EXPAND3(EXPAND3(arg))))
20#define EXPAND3(arg) EXPAND4(EXPAND4(EXPAND4(EXPAND4(arg))))
21#define EXPAND4(arg) arg
23#define FOR_EACH(macro, ...) __VA_OPT__(EXPAND(FOR_EACH_HELPER(macro, __VA_ARGS__)))
24#define FOR_EACH_HELPER(macro, a1, ...) macro(a1) __VA_OPT__(FOR_EACH_AGAIN PARENS(macro, __VA_ARGS__))
25#define FOR_EACH_AGAIN() FOR_EACH_HELPER
27#define ENUM_CASE(name) \
40#define MAKE_ENUM(type, ...) \
47 constexpr std::string toString(type _e) { \
51 FOR_EACH(ENUM_CASE, __VA_ARGS__) \
54 __builtin_unreachable(); \
57#include <dune/common/exceptions.hh>
67template <
typename MessageType>
69 if (e == MessageType::END) {
70 DUNE_THROW(Dune::RangeError,
"for MessageType& operator ++ (MessageType&)");
72 e = MessageType(
static_cast<typename std::underlying_type<MessageType>::type
>(e) + 1);
MessageType & increment(MessageType &e)
Increments the given enum value.
Definition: makeenum.hh:68
Definition: assemblermanipulatorbuildingblocks.hh:22