If we want to have a switch statement where for each case we need to run some instructions then break we would so something like this:
switch (condition) {
case (opt1):
// do stuff
break;
case (opt2):
// do stuff
break;
case (opt3):
// do stuff
break;
// ...
default:
// do stuff
}
Is it possible to have an exclusive switch, without fall through, where by default every option should break and not have to explicitly state the break instruction? And if not in C++ any idea if such a feature is available in other imperative languages?