Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
bgColor#FFCCCC
langcpp
enum enum_type {
  E_A,
  E_B,
  E_C
};

 
void f(int int_var) {
  enum_type enum_var = static_cast<enum_type>(int_var);

  if (enum_var < E_A || enum_var > E_C) {
    // Handle error
  }
}

...