Question.5
A developer handles a state machine with switch-case:
enum class State : uint8_t { IDLE, RUN, FAULT };
void handle(State s) {
switch (s) {
case State::IDLE: idle_handler(); break;
case State::RUN: run_handler(); break;
// Missing: State::FAULT
}
}What advantage does enum class provide here?