File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change 510
510
When the condition of a \tcode {while} statement is a declaration, the scope of
511
511
the variable that is declared extends from its point of
512
512
declaration\iref {basic.scope.pdecl } to the end of the \tcode {while}
513
- \grammarterm {statement}. A \tcode {while} statement of the form
514
-
515
- \begin {codeblock }
516
- while (T t = x) @\grammarterm {statement}@
517
- \end {codeblock }
518
-
513
+ \grammarterm {statement}. A \tcode {while} statement whose \grammarterm {condition}
514
+ is an initialized declaration of some variable \tcode {t}
519
515
is equivalent to
520
516
521
517
\begin {codeblock }
522
518
label:
523
519
{ // start of condition scope
524
- T t = x;
520
+ @ \grammarterm {condition}@ ; @ \, @// declares \tcode {t}
525
521
if (t) {
526
522
@\grammarterm {statement}@
527
523
goto label;
528
524
}
529
525
} // end of condition scope
530
526
\end {codeblock }
531
527
532
- The variable created in a condition is destroyed and created with each
528
+ \begin {note }
529
+ The variable created in the condition is destroyed and created with each
533
530
iteration of the loop.
534
531
\begin {example }
535
532
551
548
once for the condition that succeeds and once for the condition that
552
549
fails.
553
550
\end {example }
551
+ \end {note }
554
552
555
553
\rSec 2[stmt.do]{The \tcode {do} statement}%
556
554
\indextext {statement!\idxcode {do}}
You can’t perform that action at this time.
0 commit comments