90#define G4CT_COUNT_INIT(init_value) \
91 static constexpr G4Number<init_value> \
92 Counter(G4Number<init_value>) { \
93 return G4Number<init_value>(); \
100#define G4CT_MAX_COUNT 255
104#define G4CT_MAX_COUNT 63
108#define G4CT_COUNT(flagName) \
109 static constexpr const int flagName = decltype(Counter(G4Number<G4CT_MAX_COUNT>{}))::value; \
110 static constexpr G4Number<flagName + 1> Counter(G4Number<flagName + 1>) \
112 static_assert(flagName + 1 < G4CT_MAX_COUNT, "Maximum enumeration count exeeded"); \
113 return G4Number<flagName + 1>{}; \
121#define G4CT_COUNT_INIT_DEF(init_value) \
122 static constexpr G4Number<init_value> \
123 Counter(G4Number<init_value>);
125#define G4CT_COUNT_INIT_IMPL(enumName, init_value) \
126 constexpr G4Number<init_value> \
127 enumName::Counter(G4Number<init_value>){ \
128 return G4Number<init_value>{}; \
131#define G4CT_COUNT_DEF(flagName) \
132 static constexpr const int flagName = \
133 decltype(Counter(G4Number<G4CT_MAX_COUNT>{}))::value; \
134 static constexpr G4Number<flagName + 1> \
135 Counter(G4Number<flagName + 1>);
137#define G4CT_COUNT_IMPL(enumName, flagName) \
138 constexpr G4Number<enumName::flagName + 1> \
139 enumName::Counter(G4Number<enumName::flagName + 1>){ \
140 return G4Number<enumName::flagName +1 >{}; \
static constexpr int value