enum vs constexpr for actual static constants inside classes
For the record, the static constexpr version will work like you’d expected in C++17. From N4618 Annex D.1 [depr.static_constexpr]: D.1 Redeclaration of static constexpr data members [depr.static_constexpr] For compatibility with prior C++ International Standards, a constexpr static data member may be redundantly redeclared outside the class with no initializer. This usage is deprecated. [Example: struct … Read more