4 ms·
They missed a trick with `std::to_underlying`. It should work on all types, not just enums. By not doing that you still have to do `std::is_enum_v<T>` somewher
by secondcoming 4y ago
They missed a trick with `std::to_underlying`. It should work on all types, not just enums.
By not doing that you still have to do `std::is_enum_v<T>` somewhere.
For types that aren't enums it should do nothing (maybe `std::identity`)
- fluoridation 4y agoSeems easy enough to add your own overloaded function that does that. But then again, std::to_underlying() doesn't do much to begin with; it just casts to std::underlying_type<T>::type.