The std::to_underlying is a C++23 single-purpose cast that converts an enumerator to the underlying integral type of the enumeration. This single-step approach replaces the previous approach using static_cast in combination with the C++11 std::underlying_type utility. The std::underlying_type utility is required since the underlying type of unscoped enumerations is implementation-defined. Compiler Explorer link: https://lnkd.in/eieQ6Tqp #cpp #cplusplus #coding #programming #dailybiteofcpp
Cool!
std::to_string(e); ?