N3879: Explicit Flow Control: break label, goto case and explicit switch -- Andrew Tomazos

A new WG21 paper is available. A copy is linked below, and the paper will also appear in the next normal WG21 mailing. If you are not a committee member, please use the comments section below or the std-proposals forum for public discussion.

Document number: N3879

Date: 2014-01-17

Explicit Flow Control: break label, goto case and explicit switch

by Andrew Tomazos

Excerpt:

We propose adding to C++ some new jump statements and making available an explicit-specifier for
switch statements.

The new jump statements are break label, continue label (same as Java), goto case constant-expression
and goto default (same as C#).

An explicit switch statement (same as C#) causes each case block to have its own block scope, and to never flow off the end. That is, each case block must be explicitly exited. (The implicit fallthrough semantic between two consecutive case blocks can be expressed in an explicit switch using a goto case statement instead.)

Add a Comment

Comments are closed.

Comments (0)

There are currently no comments on this entry.