mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2025-12-17 12:44:42 +03:00
Merge pull request #965 from rsjaffe/master
Added break to each case in switch statement
This commit is contained in:
@@ -2206,9 +2206,9 @@ We might write
|
||||
bool owned;
|
||||
owner<istream*> inp;
|
||||
switch (source) {
|
||||
case std_in: owned = false; inp = &cin;
|
||||
case command_line: owned = true; inp = new istringstream{argv[2]};
|
||||
case file: owned = true; inp = new ifstream{argv[2]};
|
||||
case std_in: owned = false; inp = &cin; break;
|
||||
case command_line: owned = true; inp = new istringstream{argv[2]}; break;
|
||||
case file: owned = true; inp = new ifstream{argv[2]}; break;
|
||||
}
|
||||
istream& in = *inp;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user