Is it possible to implement a compile time counter? I want something like this (The initial value should be 0):
int main () {
constexpr int a = next ();
constexpr int b = next ();
constexpr int c = next ();
static_assert (a == 0 && b == a+1 && c == b+1, "");
}