2.4 KiB
2.4 KiB
[stmt.select.general]
8 Statements [stmt]
8.5 Selection statements [stmt.select]
8.5.1 General [stmt.select.general]
Selection statements choose one of several flows of control.
selection-statement:
if constexpropt ( init-statementopt condition ) statement
if constexpropt ( init-statementopt condition ) statement else statement
if !opt consteval compound-statement
if !opt consteval compound-statement else statement
switch ( init-statementopt condition ) statement
See [dcl.meaning] for the optional attribute-specifier-seq in a condition.
[Note 1:
An init-statement ends with a semicolon.
â end note]
[Note 2:
Each selection-statement and each substatement of a selection-statement has a block scope ([basic.scope.block]).
â end note]