C++ Logo

STD-PROPOSALS

Advanced search

Subject: [std-proposals] More flexible break statements.
From: Walt Karas (wkaras_at_[hidden])
Date: 2019-08-16 14:59:03


1.  'break short;' statement would break out of the immediately enclosing compound statement.  This would eliminate the need for the 'do { /* yada */ } while (0);' idiom.  It would be an error if the immediately enclosing compound statement were a function body.  (If the compound statement was a direct component of an iteration statement, 'break short;' would be the same as 'continue;'.)
2. 'break LABEL;' statement would break out of a directly or indirectly enclosing statement immediately preceded by the label 'LABEL:'.  It would be an error if no such statement existed.



STD-PROPOSALS list run by herb.sutter at gmail.com

Standard Proposals Archives on Google Groups