version 0.4.1
makeenum.hh File Reference

Implementation of the make enum macro. More...

#include <dune/common/exceptions.hh>

Go to the source code of this file.

Namespaces

namespace  Ikarus
 

Macros

#define PARENS   ()
 
#define ENUM_CASE(name)
 
#define EXPAND(arg)   EXPAND1(EXPAND1(EXPAND1(EXPAND1(arg))))
 
#define EXPAND1(arg)   EXPAND2(EXPAND2(EXPAND2(EXPAND2(arg))))
 
#define EXPAND2(arg)   EXPAND3(EXPAND3(EXPAND3(EXPAND3(arg))))
 
#define EXPAND3(arg)   EXPAND4(EXPAND4(EXPAND4(EXPAND4(arg))))
 
#define EXPAND4(arg)   arg
 
#define FOR_EACH(macro, ...)   __VA_OPT__(EXPAND(FOR_EACH_HELPER(macro, __VA_ARGS__)))
 
#define FOR_EACH_HELPER(macro, a1, ...)   macro(a1) __VA_OPT__(FOR_EACH_AGAIN PARENS(macro, __VA_ARGS__))
 
#define FOR_EACH_AGAIN()   FOR_EACH_HELPER
 
#define ENUM_CASE(name)
 
#define MAKE_ENUM(type, ...)
 Macro to create an enumeration with a string conversion function.The macro creates an enum class with a BEGIN and END enumerator, and provides a constexpr toString function for string conversion. More...
 

Functions

template<typename MessageType >
MessageType & Ikarus::increment (MessageType &e)
 Increments the given enum value. More...
 

Macro Definition Documentation

◆ ENUM_CASE [1/2]

#define ENUM_CASE (   name)
Value:
case name: \
return #name;

◆ ENUM_CASE [2/2]

#define ENUM_CASE (   name)
Value:
case name: \
return #name;

◆ EXPAND

#define EXPAND (   arg)    EXPAND1(EXPAND1(EXPAND1(EXPAND1(arg))))

◆ EXPAND1

#define EXPAND1 (   arg)    EXPAND2(EXPAND2(EXPAND2(EXPAND2(arg))))

◆ EXPAND2

#define EXPAND2 (   arg)    EXPAND3(EXPAND3(EXPAND3(EXPAND3(arg))))

◆ EXPAND3

#define EXPAND3 (   arg)    EXPAND4(EXPAND4(EXPAND4(EXPAND4(arg))))

◆ EXPAND4

#define EXPAND4 (   arg)    arg

◆ FOR_EACH

#define FOR_EACH (   macro,
  ... 
)    __VA_OPT__(EXPAND(FOR_EACH_HELPER(macro, __VA_ARGS__)))

◆ FOR_EACH_AGAIN

#define FOR_EACH_AGAIN ( )    FOR_EACH_HELPER

◆ FOR_EACH_HELPER

#define FOR_EACH_HELPER (   macro,
  a1,
  ... 
)    macro(a1) __VA_OPT__(FOR_EACH_AGAIN PARENS(macro, __VA_ARGS__))

◆ PARENS

#define PARENS   ()