Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Good point, I suppose of course it does, since enums are just ints. But C++20 adds support for enum classes (and also variants when they can be defined as value types with a defaulted operator<==>).


> But C++20 adds support for enum classes

It seems to work fine with `enum class` under C++11 ? your code works almost inchanged in g++ 4.7. I don't see anything here : https://en.cppreference.com/w/cpp/language/template_paramete... that adds specific support for that in C++20


Wow it does too, not sure where I got it into my head that it didn't then.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: