How to do it...

  • Prefer to use scoped enumerations instead of unscoped ones.
  • In order to use scoped enumerations, you should declare enumerations using enum class or enum struct:
        enum class Status { Unknown, Created, Connected };
Status s = Status::Created;
The enum class and enum struct declarations are equivalent, and throughout this recipe and the rest of the book, we will use enum class.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset