在 C++ 中是否可以执行以下操作?
switch (value) {
case 0:
// code statements
break;
case 1:
case 2:
// code statements for case 1 and case 2
/**insert statement other than break here
that makes the switch statement continue
evaluating case statements rather than
exit the switch**/
case 2:
// code statements specific for case 2
break;
}
我想知道是否有办法让 switch 语句即使在遇到匹配的情况后也继续评估其余的情况。(如continue
其他语言的声明)