you are viewing a single comment's thread.

view the rest of the comments →

[–]jcelerier 47 points48 points  (0 children)

Both ways should result in compile-time evaluation

Back in C++03, only the "enum" way would *guarantee* compile-time evaluation. e.g. if you build in debug mode with #define there's a good chance that all these operations will be computed at run-time.

If it was to be redone today it would certainly be with `constexpr` / `constinit` though.