C++ Logo

std-proposals

Advanced search

More flexible break statements.

From: Walt Karas <wkaras_at_[hidden]>
Date: Fri, 16 Aug 2019 19:59:03 +0000 (UTC)
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.

Received on 2019-08-16 15:01:38