vendredi 17 août 2018

Is it possible to determine if an enumeration was strongly typed?

C++11 introduced two different additions to how we can handle enums: an option to make them scoped, and an option to make them typed. So now we have four different enum subtypes:

enum Old {};
enum Typed : int8_t {};
enum class Scoped {};
enum class TypedScoped : int8_t {};

This question asks how to determine whether the enumeration is scoped. I want to know how to determine whether the enumeration is typed.

Aucun commentaire:

Enregistrer un commentaire