summaryrefslogtreecommitdiff
path: root/devdocs/gcc~13/c99-like-fast-enumeration-syntax.html
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2024-04-07 13:41:34 -0500
committerCraig Jennings <c@cjennings.net>2024-04-07 13:41:34 -0500
commit754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 (patch)
treef1190704f78f04a2b0b4c977d20fe96a828377f1 /devdocs/gcc~13/c99-like-fast-enumeration-syntax.html
new repository
Diffstat (limited to 'devdocs/gcc~13/c99-like-fast-enumeration-syntax.html')
-rw-r--r--devdocs/gcc~13/c99-like-fast-enumeration-syntax.html21
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">
+ &copy; 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>