mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2024-03-22 13:30:58 +08:00
Fix example for ES.70
As per #574, fixes the example in ES.70 to emphasize good use of a switch over a sequence of if-else-if statements.
This commit is contained in:
parent
42f8fa5f84
commit
184fe5397f
|
@ -12051,8 +12051,15 @@ Statements control the flow of control (except for function calls and exception
|
||||||
void use(int n)
|
void use(int n)
|
||||||
{
|
{
|
||||||
switch (n) { // good
|
switch (n) { // good
|
||||||
case 0: // ...
|
case 0:
|
||||||
case 7: // ...
|
// ...
|
||||||
|
break;
|
||||||
|
case 7:
|
||||||
|
// ...
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
// ...
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user