90#define G4CT_COUNT_INIT(init_value) \
91 static constexpr G4Number<init_value> \
92 Counter(G4Number<init_value>) { \
93 return G4Number<init_value>(); \
96#define G4CT_COUNT(flagName) \
97 static constexpr const int flagName = \
98 decltype(Counter(G4Number<255>{}) )::value; \
99 static constexpr G4Number<flagName + 1> \
100 Counter(G4Number<flagName + 1>){ \
101 return G4Number<flagName +1 >{}; \
109#define G4CT_COUNT_INIT_DEF(init_value) \
110 static constexpr G4Number<init_value> \
111 Counter(G4Number<init_value>);
113#define G4CT_COUNT_INIT_IMPL(enumName, init_value) \
114 constexpr G4Number<init_value> \
115 enumName::Counter(G4Number<init_value>){ \
116 return G4Number<init_value>{}; \
119#define G4CT_COUNT_DEF(flagName) \
120 static constexpr const int flagName = \
121 decltype(Counter(G4Number<255>{}))::value; \
122 static constexpr G4Number<flagName + 1> \
123 Counter(G4Number<flagName + 1>);
125#define G4CT_COUNT_IMPL(enumName, flagName) \
126 constexpr G4Number<enumName::flagName + 1> \
127 enumName::Counter(G4Number<enumName::flagName + 1>){ \
128 return G4Number<enumName::flagName +1 >{}; \
static constexpr int value