How to implement a constant-expression counter in C++ | Hacker News Reader