- Use templates like these if you have many enum types and often convert them to integers. The 1-arg template converts an enum type to its underlying type. PS: std::to_integer converts only from std::byte and the integer type must be explicit. sigcpp.godbolt.org/z/4Waxaojrz #cpp #cplusplusJul 6, 2023 18:54