diff options
Diffstat (limited to 'devdocs/gcc~13/c99-like-fast-enumeration-syntax.html')
| -rw-r--r-- | devdocs/gcc~13/c99-like-fast-enumeration-syntax.html | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/devdocs/gcc~13/c99-like-fast-enumeration-syntax.html b/devdocs/gcc~13/c99-like-fast-enumeration-syntax.html new file mode 100644 index 00000000..3bae2368 --- /dev/null +++ b/devdocs/gcc~13/c99-like-fast-enumeration-syntax.html @@ -0,0 +1,21 @@ +<div class="subsection-level-extent" id="c99-like-fast-enumeration-syntax"> <div class="nav-panel"> <p> Next: <a href="fast-enumeration-details" accesskey="n" rel="next">Fast Enumeration Details</a>, Previous: <a href="using-fast-enumeration" accesskey="p" rel="prev">Using Fast Enumeration</a>, Up: <a href="fast-enumeration" accesskey="u" rel="up">Fast Enumeration</a> [<a href="index#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="indices" title="Index" rel="index">Index</a>]</p> </div> <h1 class="subsection" id="C99-Like-Fast-Enumeration-Syntax"><span>8.9.2 C99-Like Fast Enumeration Syntax<a class="copiable-link" href="#C99-Like-Fast-Enumeration-Syntax"> ¶</a></span></h1> <p>A c99-like declaration syntax is also allowed: </p> <div class="example smallexample"> <pre class="example-preformatted" data-language="cpp">id array = …; + +for (id object in array) +{ + /* Do something with 'object' */ +}</pre> +</div> <p>this is completely equivalent to: </p> <div class="example smallexample"> <pre class="example-preformatted" data-language="cpp">id array = …; + +{ + id object; + for (object in array) + { + /* Do something with 'object' */ + } +}</pre> +</div> <p>but can save some typing. </p> <p>Note that the option <samp class="option">-std=c99</samp> is not required to allow this syntax in Objective-C. </p> </div><div class="_attribution"> + <p class="_attribution-p"> + © Free Software Foundation<br>Licensed under the GNU Free Documentation License, Version 1.3.<br> + <a href="https://gcc.gnu.org/onlinedocs/gcc-13.1.0/gcc/c99-like-fast-enumeration-syntax.html" class="_attribution-link">https://gcc.gnu.org/onlinedocs/gcc-13.1.0/gcc/c99-like-fast-enumeration-syntax.html</a> + </p> +</div> |
