标签: c++ c++14
是否可以实现编译时间计数器? 我想要这样的东西(初始值应为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, ""); }