diff options
Diffstat (limited to 'libs/phoenix/doc/html/phoenix/modules/statement')
9 files changed, 703 insertions, 0 deletions
diff --git a/libs/phoenix/doc/html/phoenix/modules/statement/___do_while_____statement.html b/libs/phoenix/doc/html/phoenix/modules/statement/___do_while_____statement.html new file mode 100644 index 0000000000..271be2c453 --- /dev/null +++ b/libs/phoenix/doc/html/phoenix/modules/statement/___do_while_____statement.html @@ -0,0 +1,73 @@ +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> +<title>do_while_ Statement</title> +<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css"> +<meta name="generator" content="DocBook XSL Stylesheets V1.76.1"> +<link rel="home" href="../../../index.html" title="Chapter 1. Phoenix 3.0"> +<link rel="up" href="../statement.html" title="Statement"> +<link rel="prev" href="while__statement.html" title="while_ Statement"> +<link rel="next" href="for_statement.html" title="for_ Statement"> +</head> +<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> +<table cellpadding="2" width="100%"><tr> +<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td> +<td align="center"><a href="../../../../../../../index.html">Home</a></td> +<td align="center"><a href="../../../../../../../libs/libraries.htm">Libraries</a></td> +<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td> +<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td> +<td align="center"><a href="../../../../../../../more/index.htm">More</a></td> +</tr></table> +<hr> +<div class="spirit-nav"> +<a accesskey="p" href="while__statement.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../statement.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="for_statement.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a> +</div> +<div class="section"> +<div class="titlepage"><div><div><h4 class="title"> +<a name="phoenix.modules.statement.___do_while_____statement"></a><a class="link" href="___do_while_____statement.html" title="do_while_ Statement">do_while_ Statement</a> +</h4></div></div></div> +<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">phoenix</span><span class="special">/</span><span class="identifier">statement</span><span class="special">/</span><span class="identifier">do_while</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span> +</pre> +<p> + The syntax is: + </p> +<pre class="programlisting"><span class="identifier">do_</span> +<span class="special">[</span> + <span class="identifier">sequenced_statements</span> +<span class="special">]</span> +<span class="special">.</span><span class="identifier">while_</span><span class="special">(</span><span class="identifier">conditional_expression</span><span class="special">)</span> +</pre> +<p> + Again, take note that <code class="computeroutput"><span class="keyword">while</span></code> + has a leading dot and a trailing underscore: <code class="computeroutput"><span class="special">.</span><span class="identifier">while_</span></code> + </p> +<p> + Example: This code is almost the same as the previous example above with + a slight twist in logic. + </p> +<pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">for_each</span><span class="special">(</span><span class="identifier">c</span><span class="special">.</span><span class="identifier">begin</span><span class="special">(),</span> <span class="identifier">c</span><span class="special">.</span><span class="identifier">end</span><span class="special">(),</span> + <span class="special">(</span> + <span class="identifier">do_</span> + <span class="special">[</span> + <span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">arg1</span> <span class="special"><<</span> <span class="string">", "</span> + <span class="special">]</span> + <span class="special">.</span><span class="identifier">while_</span><span class="special">(</span><span class="identifier">arg1</span><span class="special">--),</span> + <span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">val</span><span class="special">(</span><span class="string">"\n"</span><span class="special">)</span> + <span class="special">)</span> +<span class="special">);</span> +</pre> +</div> +<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> +<td align="left"></td> +<td align="right"><div class="copyright-footer">Copyright © 2002-2005, 2010 Joel de Guzman, Dan Marsden, Thomas Heller<p> + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>) + </p> +</div></td> +</tr></table> +<hr> +<div class="spirit-nav"> +<a accesskey="p" href="while__statement.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../statement.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="for_statement.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a> +</div> +</body> +</html> diff --git a/libs/phoenix/doc/html/phoenix/modules/statement/___if_else_____statement.html b/libs/phoenix/doc/html/phoenix/modules/statement/___if_else_____statement.html new file mode 100644 index 0000000000..991df896df --- /dev/null +++ b/libs/phoenix/doc/html/phoenix/modules/statement/___if_else_____statement.html @@ -0,0 +1,88 @@ +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> +<title>if_else_ Statement</title> +<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css"> +<meta name="generator" content="DocBook XSL Stylesheets V1.76.1"> +<link rel="home" href="../../../index.html" title="Chapter 1. Phoenix 3.0"> +<link rel="up" href="../statement.html" title="Statement"> +<link rel="prev" href="if__statement.html" title="if_ Statement"> +<link rel="next" href="switch__statement.html" title="switch_ Statement"> +</head> +<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> +<table cellpadding="2" width="100%"><tr> +<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td> +<td align="center"><a href="../../../../../../../index.html">Home</a></td> +<td align="center"><a href="../../../../../../../libs/libraries.htm">Libraries</a></td> +<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td> +<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td> +<td align="center"><a href="../../../../../../../more/index.htm">More</a></td> +</tr></table> +<hr> +<div class="spirit-nav"> +<a accesskey="p" href="if__statement.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../statement.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="switch__statement.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a> +</div> +<div class="section"> +<div class="titlepage"><div><div><h4 class="title"> +<a name="phoenix.modules.statement.___if_else_____statement"></a><a class="link" href="___if_else_____statement.html" title="if_else_ Statement">if_else_ Statement</a> +</h4></div></div></div> +<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">phoenix</span><span class="special">/</span><span class="identifier">statement</span><span class="special">/</span><span class="keyword">if</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span> +</pre> +<p> + The syntax is + </p> +<pre class="programlisting"><span class="identifier">if_</span><span class="special">(</span><span class="identifier">conditional_expression</span><span class="special">)</span> +<span class="special">[</span> + <span class="identifier">sequenced_statements</span> +<span class="special">]</span> +<span class="special">.</span><span class="identifier">else_</span> +<span class="special">[</span> + <span class="identifier">sequenced_statements</span> +<span class="special">]</span> +</pre> +<p> + Take note that <code class="computeroutput"><span class="keyword">else</span></code> has a + leading dot and a trailing underscore: <code class="computeroutput"><span class="special">.</span><span class="identifier">else_</span></code> + </p> +<p> + Example: This code prints out all the elements and appends <code class="computeroutput"><span class="string">" > 5"</span></code>, <code class="computeroutput"><span class="string">" + == 5"</span></code> or <code class="computeroutput"><span class="string">" < 5"</span></code> + depending on the element's actual value: + </p> +<pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">for_each</span><span class="special">(</span><span class="identifier">c</span><span class="special">.</span><span class="identifier">begin</span><span class="special">(),</span> <span class="identifier">c</span><span class="special">.</span><span class="identifier">end</span><span class="special">(),</span> + <span class="identifier">if_</span><span class="special">(</span><span class="identifier">arg1</span> <span class="special">></span> <span class="number">5</span><span class="special">)</span> + <span class="special">[</span> + <span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">arg1</span> <span class="special"><<</span> <span class="string">" > 5\n"</span> + <span class="special">]</span> + <span class="special">.</span><span class="identifier">else_</span> + <span class="special">[</span> + <span class="identifier">if_</span><span class="special">(</span><span class="identifier">arg1</span> <span class="special">==</span> <span class="number">5</span><span class="special">)</span> + <span class="special">[</span> + <span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">arg1</span> <span class="special"><<</span> <span class="string">" == 5\n"</span> + <span class="special">]</span> + <span class="special">.</span><span class="identifier">else_</span> + <span class="special">[</span> + <span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">arg1</span> <span class="special"><<</span> <span class="string">" < 5\n"</span> + <span class="special">]</span> + <span class="special">]</span> +<span class="special">);</span> +</pre> +<p> + Notice how the <code class="computeroutput"><span class="identifier">if_else_</span></code> + statement is nested. + </p> +</div> +<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> +<td align="left"></td> +<td align="right"><div class="copyright-footer">Copyright © 2002-2005, 2010 Joel de Guzman, Dan Marsden, Thomas Heller<p> + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>) + </p> +</div></td> +</tr></table> +<hr> +<div class="spirit-nav"> +<a accesskey="p" href="if__statement.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../statement.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="switch__statement.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a> +</div> +</body> +</html> diff --git a/libs/phoenix/doc/html/phoenix/modules/statement/block_statement.html b/libs/phoenix/doc/html/phoenix/modules/statement/block_statement.html new file mode 100644 index 0000000000..62ee942f60 --- /dev/null +++ b/libs/phoenix/doc/html/phoenix/modules/statement/block_statement.html @@ -0,0 +1,91 @@ +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> +<title>Block Statement</title> +<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css"> +<meta name="generator" content="DocBook XSL Stylesheets V1.76.1"> +<link rel="home" href="../../../index.html" title="Chapter 1. Phoenix 3.0"> +<link rel="up" href="../statement.html" title="Statement"> +<link rel="prev" href="../statement.html" title="Statement"> +<link rel="next" href="if__statement.html" title="if_ Statement"> +</head> +<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> +<table cellpadding="2" width="100%"><tr> +<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td> +<td align="center"><a href="../../../../../../../index.html">Home</a></td> +<td align="center"><a href="../../../../../../../libs/libraries.htm">Libraries</a></td> +<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td> +<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td> +<td align="center"><a href="../../../../../../../more/index.htm">More</a></td> +</tr></table> +<hr> +<div class="spirit-nav"> +<a accesskey="p" href="../statement.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../statement.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="if__statement.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a> +</div> +<div class="section"> +<div class="titlepage"><div><div><h4 class="title"> +<a name="phoenix.modules.statement.block_statement"></a><a class="link" href="block_statement.html" title="Block Statement">Block Statement</a> +</h4></div></div></div> +<p> + Syntax: + </p> +<pre class="programlisting"><span class="identifier">statement</span><span class="special">,</span> +<span class="identifier">statement</span><span class="special">,</span> +<span class="special">....</span> +<span class="identifier">statement</span> +</pre> +<p> + Basically, these are comma separated statements. Take note that unlike + the C/C++ semicolon, the comma is a separator put <span class="bold"><strong>in-between</strong></span> + statements. This is like Pascal's semicolon separator, rather than C/C++'s + semicolon terminator. For example: + </p> +<pre class="programlisting"><span class="identifier">statement</span><span class="special">,</span> +<span class="identifier">statement</span><span class="special">,</span> +<span class="identifier">statement</span><span class="special">,</span> <span class="comment">// ERROR!</span> +</pre> +<p> + Is an error. The last statement should not have a comma. Block statements + can be grouped using the parentheses. Again, the last statement in a group + should not have a trailing comma. + </p> +<pre class="programlisting"><span class="identifier">statement</span><span class="special">,</span> +<span class="identifier">statement</span><span class="special">,</span> +<span class="special">(</span> + <span class="identifier">statement</span><span class="special">,</span> + <span class="identifier">statement</span> +<span class="special">),</span> +<span class="identifier">statement</span> +</pre> +<p> + Outside the square brackets, block statements should be grouped. For example: + </p> +<pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">for_each</span><span class="special">(</span><span class="identifier">c</span><span class="special">.</span><span class="identifier">begin</span><span class="special">(),</span> <span class="identifier">c</span><span class="special">.</span><span class="identifier">end</span><span class="special">(),</span> + <span class="special">(</span> + <span class="identifier">do_this</span><span class="special">(</span><span class="identifier">arg1</span><span class="special">),</span> + <span class="identifier">do_that</span><span class="special">(</span><span class="identifier">arg1</span><span class="special">)</span> + <span class="special">)</span> +<span class="special">);</span> +</pre> +<p> + Wrapping a comma operator chain around a parentheses pair blocks the interpretation + as an argument separator. The reason for the exception for the square bracket + operator is that the operator always takes exactly one argument, so it + "transforms" any attempt at multiple arguments with a comma operator + chain (and spits out an error for zero arguments). + </p> +</div> +<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> +<td align="left"></td> +<td align="right"><div class="copyright-footer">Copyright © 2002-2005, 2010 Joel de Guzman, Dan Marsden, Thomas Heller<p> + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>) + </p> +</div></td> +</tr></table> +<hr> +<div class="spirit-nav"> +<a accesskey="p" href="../statement.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../statement.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="if__statement.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a> +</div> +</body> +</html> diff --git a/libs/phoenix/doc/html/phoenix/modules/statement/for_statement.html b/libs/phoenix/doc/html/phoenix/modules/statement/for_statement.html new file mode 100644 index 0000000000..232fa356a2 --- /dev/null +++ b/libs/phoenix/doc/html/phoenix/modules/statement/for_statement.html @@ -0,0 +1,81 @@ +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> +<title>for_ Statement</title> +<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css"> +<meta name="generator" content="DocBook XSL Stylesheets V1.76.1"> +<link rel="home" href="../../../index.html" title="Chapter 1. Phoenix 3.0"> +<link rel="up" href="../statement.html" title="Statement"> +<link rel="prev" href="___do_while_____statement.html" title="do_while_ Statement"> +<link rel="next" href="try__catch__statement.html" title="try_ catch_ Statement"> +</head> +<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> +<table cellpadding="2" width="100%"><tr> +<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td> +<td align="center"><a href="../../../../../../../index.html">Home</a></td> +<td align="center"><a href="../../../../../../../libs/libraries.htm">Libraries</a></td> +<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td> +<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td> +<td align="center"><a href="../../../../../../../more/index.htm">More</a></td> +</tr></table> +<hr> +<div class="spirit-nav"> +<a accesskey="p" href="___do_while_____statement.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../statement.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="try__catch__statement.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a> +</div> +<div class="section"> +<div class="titlepage"><div><div><h4 class="title"> +<a name="phoenix.modules.statement.for_statement"></a><a class="link" href="for_statement.html" title="for_ Statement">for_ Statement</a> +</h4></div></div></div> +<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">phoenix</span><span class="special">/</span><span class="identifier">statement</span><span class="special">/</span><span class="keyword">for</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span> +</pre> +<p> + The syntax is: + </p> +<pre class="programlisting"><span class="identifier">for_</span><span class="special">(</span><span class="identifier">init_statement</span><span class="special">,</span> <span class="identifier">conditional_expression</span><span class="special">,</span> <span class="identifier">step_statement</span><span class="special">)</span> +<span class="special">[</span> + <span class="identifier">sequenced_statements</span> +<span class="special">]</span> +</pre> +<p> + It is again very similar to the C++ for statement. Take note that the init_statement, + conditional_expression and step_statement are separated by the comma instead of the semi-colon + and each must be present (i.e. <code class="computeroutput"><span class="identifier">for_</span><span class="special">(,,)</span></code> is invalid). This is a case where the + <a class="link" href="../core/nothing.html" title="Nothing"><code class="computeroutput"><span class="identifier">nothing</span></code></a> + actor can be useful. + </p> +<p> + Example: This code prints each element N times where N is the element's + value. A newline terminates the printout of each value. + </p> +<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">iii</span><span class="special">;</span> +<span class="identifier">std</span><span class="special">::</span><span class="identifier">for_each</span><span class="special">(</span><span class="identifier">c</span><span class="special">.</span><span class="identifier">begin</span><span class="special">(),</span> <span class="identifier">c</span><span class="special">.</span><span class="identifier">end</span><span class="special">(),</span> + <span class="special">(</span> + <span class="identifier">for_</span><span class="special">(</span><span class="identifier">ref</span><span class="special">(</span><span class="identifier">iii</span><span class="special">)</span> <span class="special">=</span> <span class="number">0</span><span class="special">,</span> <span class="identifier">ref</span><span class="special">(</span><span class="identifier">iii</span><span class="special">)</span> <span class="special"><</span> <span class="identifier">arg1</span><span class="special">,</span> <span class="special">++</span><span class="identifier">ref</span><span class="special">(</span><span class="identifier">iii</span><span class="special">))</span> + <span class="special">[</span> + <span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">arg1</span> <span class="special"><<</span> <span class="string">", "</span> + <span class="special">],</span> + <span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">val</span><span class="special">(</span><span class="string">"\n"</span><span class="special">)</span> + <span class="special">)</span> +<span class="special">);</span> +</pre> +<p> + As before, all these are lazily evaluated. The result of such statements + are in fact expressions that are passed on to STL's for_each function. + In the viewpoint of <code class="computeroutput"><span class="identifier">for_each</span></code>, + what was passed is just a functor, no more, no less. + </p> +</div> +<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> +<td align="left"></td> +<td align="right"><div class="copyright-footer">Copyright © 2002-2005, 2010 Joel de Guzman, Dan Marsden, Thomas Heller<p> + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>) + </p> +</div></td> +</tr></table> +<hr> +<div class="spirit-nav"> +<a accesskey="p" href="___do_while_____statement.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../statement.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="try__catch__statement.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a> +</div> +</body> +</html> diff --git a/libs/phoenix/doc/html/phoenix/modules/statement/if__statement.html b/libs/phoenix/doc/html/phoenix/modules/statement/if__statement.html new file mode 100644 index 0000000000..a36dc49dff --- /dev/null +++ b/libs/phoenix/doc/html/phoenix/modules/statement/if__statement.html @@ -0,0 +1,54 @@ +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> +<title>if_ Statement</title> +<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css"> +<meta name="generator" content="DocBook XSL Stylesheets V1.76.1"> +<link rel="home" href="../../../index.html" title="Chapter 1. Phoenix 3.0"> +<link rel="up" href="../statement.html" title="Statement"> +<link rel="prev" href="block_statement.html" title="Block Statement"> +<link rel="next" href="___if_else_____statement.html" title="if_else_ Statement"> +</head> +<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> +<table cellpadding="2" width="100%"><tr> +<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td> +<td align="center"><a href="../../../../../../../index.html">Home</a></td> +<td align="center"><a href="../../../../../../../libs/libraries.htm">Libraries</a></td> +<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td> +<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td> +<td align="center"><a href="../../../../../../../more/index.htm">More</a></td> +</tr></table> +<hr> +<div class="spirit-nav"> +<a accesskey="p" href="block_statement.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../statement.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="___if_else_____statement.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a> +</div> +<div class="section"> +<div class="titlepage"><div><div><h4 class="title"> +<a name="phoenix.modules.statement.if__statement"></a><a class="link" href="if__statement.html" title="if_ Statement">if_ Statement</a> +</h4></div></div></div> +<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">phoenix</span><span class="special">/</span><span class="identifier">statement</span><span class="special">/</span><span class="keyword">if</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span> +</pre> +<p> + We have seen the <code class="computeroutput"><span class="identifier">if_</span></code> statement. + The syntax is: + </p> +<pre class="programlisting"><span class="identifier">if_</span><span class="special">(</span><span class="identifier">conditional_expression</span><span class="special">)</span> +<span class="special">[</span> + <span class="identifier">sequenced_statements</span> +<span class="special">]</span> +</pre> +</div> +<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> +<td align="left"></td> +<td align="right"><div class="copyright-footer">Copyright © 2002-2005, 2010 Joel de Guzman, Dan Marsden, Thomas Heller<p> + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>) + </p> +</div></td> +</tr></table> +<hr> +<div class="spirit-nav"> +<a accesskey="p" href="block_statement.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../statement.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="___if_else_____statement.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a> +</div> +</body> +</html> diff --git a/libs/phoenix/doc/html/phoenix/modules/statement/switch__statement.html b/libs/phoenix/doc/html/phoenix/modules/statement/switch__statement.html new file mode 100644 index 0000000000..811ff36c18 --- /dev/null +++ b/libs/phoenix/doc/html/phoenix/modules/statement/switch__statement.html @@ -0,0 +1,74 @@ +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> +<title>switch_ Statement</title> +<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css"> +<meta name="generator" content="DocBook XSL Stylesheets V1.76.1"> +<link rel="home" href="../../../index.html" title="Chapter 1. Phoenix 3.0"> +<link rel="up" href="../statement.html" title="Statement"> +<link rel="prev" href="___if_else_____statement.html" title="if_else_ Statement"> +<link rel="next" href="while__statement.html" title="while_ Statement"> +</head> +<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> +<table cellpadding="2" width="100%"><tr> +<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td> +<td align="center"><a href="../../../../../../../index.html">Home</a></td> +<td align="center"><a href="../../../../../../../libs/libraries.htm">Libraries</a></td> +<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td> +<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td> +<td align="center"><a href="../../../../../../../more/index.htm">More</a></td> +</tr></table> +<hr> +<div class="spirit-nav"> +<a accesskey="p" href="___if_else_____statement.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../statement.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="while__statement.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a> +</div> +<div class="section"> +<div class="titlepage"><div><div><h4 class="title"> +<a name="phoenix.modules.statement.switch__statement"></a><a class="link" href="switch__statement.html" title="switch_ Statement">switch_ + Statement</a> +</h4></div></div></div> +<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">phoenix</span><span class="special">/</span><span class="identifier">statement</span><span class="special">/</span><span class="keyword">switch</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span> +</pre> +<p> + The syntax is: + </p> +<pre class="programlisting"><span class="identifier">switch_</span><span class="special">(</span><span class="identifier">integral_expression</span><span class="special">)</span> +<span class="special">[</span> + <span class="identifier">case_</span><span class="special"><</span><span class="identifier">integral_value</span><span class="special">>(</span><span class="identifier">sequenced_statements</span><span class="special">),</span> + <span class="special">...</span> + <span class="identifier">default_</span><span class="special"><</span><span class="identifier">integral_value</span><span class="special">>(</span><span class="identifier">sequenced_statements</span><span class="special">)</span> +<span class="special">]</span> +</pre> +<p> + A comma separated list of cases, and an optional default can be provided. + Note unlike a normal switch statement, cases do not fall through. + </p> +<p> + Example: This code prints out <code class="computeroutput"><span class="string">"one"</span></code>, + <code class="computeroutput"><span class="string">"two"</span></code> or <code class="computeroutput"><span class="string">"other value"</span></code> depending on the + element's actual value: + </p> +<pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">for_each</span><span class="special">(</span><span class="identifier">c</span><span class="special">.</span><span class="identifier">begin</span><span class="special">(),</span> <span class="identifier">c</span><span class="special">.</span><span class="identifier">end</span><span class="special">(),</span> + <span class="identifier">switch_</span><span class="special">(</span><span class="identifier">arg1</span><span class="special">)</span> + <span class="special">[</span> + <span class="identifier">case_</span><span class="special"><</span><span class="number">1</span><span class="special">>(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">val</span><span class="special">(</span><span class="string">"one"</span><span class="special">)</span> <span class="special"><<</span> <span class="char">'\n'</span><span class="special">),</span> + <span class="identifier">case_</span><span class="special"><</span><span class="number">2</span><span class="special">>(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">val</span><span class="special">(</span><span class="string">"two"</span><span class="special">)</span> <span class="special"><<</span> <span class="char">'\n'</span><span class="special">),</span> + <span class="identifier">default_</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">val</span><span class="special">(</span><span class="string">"other value"</span><span class="special">)</span> <span class="special"><<</span> <span class="char">'\n'</span><span class="special">)</span> + <span class="special">]</span> +<span class="special">);</span> +</pre> +</div> +<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> +<td align="left"></td> +<td align="right"><div class="copyright-footer">Copyright © 2002-2005, 2010 Joel de Guzman, Dan Marsden, Thomas Heller<p> + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>) + </p> +</div></td> +</tr></table> +<hr> +<div class="spirit-nav"> +<a accesskey="p" href="___if_else_____statement.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../statement.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="while__statement.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a> +</div> +</body> +</html> diff --git a/libs/phoenix/doc/html/phoenix/modules/statement/throw_.html b/libs/phoenix/doc/html/phoenix/modules/statement/throw_.html new file mode 100644 index 0000000000..c115029cbf --- /dev/null +++ b/libs/phoenix/doc/html/phoenix/modules/statement/throw_.html @@ -0,0 +1,84 @@ +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> +<title>throw_</title> +<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css"> +<meta name="generator" content="DocBook XSL Stylesheets V1.76.1"> +<link rel="home" href="../../../index.html" title="Chapter 1. Phoenix 3.0"> +<link rel="up" href="../statement.html" title="Statement"> +<link rel="prev" href="try__catch__statement.html" title="try_ catch_ Statement"> +<link rel="next" href="../object.html" title="Object"> +</head> +<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> +<table cellpadding="2" width="100%"><tr> +<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td> +<td align="center"><a href="../../../../../../../index.html">Home</a></td> +<td align="center"><a href="../../../../../../../libs/libraries.htm">Libraries</a></td> +<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td> +<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td> +<td align="center"><a href="../../../../../../../more/index.htm">More</a></td> +</tr></table> +<hr> +<div class="spirit-nav"> +<a accesskey="p" href="try__catch__statement.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../statement.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../object.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a> +</div> +<div class="section"> +<div class="titlepage"><div><div><h4 class="title"> +<a name="phoenix.modules.statement.throw_"></a><a class="link" href="throw_.html" title="throw_">throw_</a> +</h4></div></div></div> +<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">phoenix</span><span class="special">/</span><span class="identifier">statement</span><span class="special">/</span><span class="keyword">throw</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span> +</pre> +<p> + As a natural companion to the try/catch support, the statement module provides + lazy throwing and re-throwing of exceptions. + </p> +<p> + The syntax to throw an exception is: + </p> +<pre class="programlisting"><span class="identifier">throw_</span><span class="special">(</span><span class="identifier">exception_expression</span><span class="special">)</span> +</pre> +<p> + The syntax to re-throw an exception is: + </p> +<pre class="programlisting"><span class="identifier">throw_</span><span class="special">()</span> +</pre> +<p> + Example: This code extends the try/catch example, re-throwing exceptions + derived from runtime_error or exception, and translating other exception + types to runtime_errors. + </p> +<pre class="programlisting"><span class="identifier">try_</span> +<span class="special">[</span> + <span class="identifier">f</span><span class="special">(</span><span class="identifier">arg1</span><span class="special">)</span> +<span class="special">]</span> +<span class="special">.</span><span class="identifier">catch_</span><span class="special"><</span><span class="identifier">runtime_error</span><span class="special">>()</span> +<span class="special">[</span> + <span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">val</span><span class="special">(</span><span class="string">"caught runtime error or derived\n"</span><span class="special">),</span> + <span class="identifier">throw_</span><span class="special">()</span> +<span class="special">]</span> +<span class="special">.</span><span class="identifier">catch_</span><span class="special"><</span><span class="identifier">exception</span><span class="special">>()</span> +<span class="special">[</span> + <span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">val</span><span class="special">(</span><span class="string">"caught exception or derived\n"</span><span class="special">),</span> + <span class="identifier">throw_</span><span class="special">()</span> +<span class="special">]</span> +<span class="special">.</span><span class="identifier">catch_all</span> +<span class="special">[</span> + <span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">val</span><span class="special">(</span><span class="string">"caught some other type of exception\n"</span><span class="special">),</span> + <span class="identifier">throw_</span><span class="special">(</span><span class="identifier">runtime_error</span><span class="special">(</span><span class="string">"translated exception"</span><span class="special">))</span> +<span class="special">]</span> +</pre> +</div> +<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> +<td align="left"></td> +<td align="right"><div class="copyright-footer">Copyright © 2002-2005, 2010 Joel de Guzman, Dan Marsden, Thomas Heller<p> + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>) + </p> +</div></td> +</tr></table> +<hr> +<div class="spirit-nav"> +<a accesskey="p" href="try__catch__statement.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../statement.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../object.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a> +</div> +</body> +</html> diff --git a/libs/phoenix/doc/html/phoenix/modules/statement/try__catch__statement.html b/libs/phoenix/doc/html/phoenix/modules/statement/try__catch__statement.html new file mode 100644 index 0000000000..e97ab4606f --- /dev/null +++ b/libs/phoenix/doc/html/phoenix/modules/statement/try__catch__statement.html @@ -0,0 +1,89 @@ +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> +<title>try_ catch_ Statement</title> +<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css"> +<meta name="generator" content="DocBook XSL Stylesheets V1.76.1"> +<link rel="home" href="../../../index.html" title="Chapter 1. Phoenix 3.0"> +<link rel="up" href="../statement.html" title="Statement"> +<link rel="prev" href="for_statement.html" title="for_ Statement"> +<link rel="next" href="throw_.html" title="throw_"> +</head> +<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> +<table cellpadding="2" width="100%"><tr> +<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td> +<td align="center"><a href="../../../../../../../index.html">Home</a></td> +<td align="center"><a href="../../../../../../../libs/libraries.htm">Libraries</a></td> +<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td> +<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td> +<td align="center"><a href="../../../../../../../more/index.htm">More</a></td> +</tr></table> +<hr> +<div class="spirit-nav"> +<a accesskey="p" href="for_statement.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../statement.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="throw_.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a> +</div> +<div class="section"> +<div class="titlepage"><div><div><h4 class="title"> +<a name="phoenix.modules.statement.try__catch__statement"></a><a class="link" href="try__catch__statement.html" title="try_ catch_ Statement">try_ + catch_ Statement</a> +</h4></div></div></div> +<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">phoenix</span><span class="special">/</span><span class="identifier">statement</span><span class="special">/</span><span class="identifier">try_catch</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span> +</pre> +<p> + The syntax is: + </p> +<pre class="programlisting"><span class="identifier">try_</span> +<span class="special">[</span> + <span class="identifier">sequenced_statements</span> +<span class="special">]</span> +<span class="special">.</span><span class="identifier">catch_</span><span class="special"><</span><span class="identifier">exception_type</span><span class="special">>()</span> +<span class="special">[</span> + <span class="identifier">sequenced_statements</span> +<span class="special">]</span> +<span class="special">...</span> +<span class="special">.</span><span class="identifier">catch_all</span> +<span class="special">[</span> + <span class="identifier">sequenced_statement</span> +<span class="special">]</span> +</pre> +<p> + Note the usual underscore after try and catch, and the extra parentheses + required after the catch. + </p> +<p> + Example: The following code calls the (lazy) function <code class="computeroutput"><span class="identifier">f</span></code> + for each element, and prints messages about different exception types it + catches. + </p> +<pre class="programlisting"><span class="identifier">try_</span> +<span class="special">[</span> + <span class="identifier">f</span><span class="special">(</span><span class="identifier">arg1</span><span class="special">)</span> +<span class="special">]</span> +<span class="special">.</span><span class="identifier">catch_</span><span class="special"><</span><span class="identifier">runtime_error</span><span class="special">>()</span> +<span class="special">[</span> + <span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">val</span><span class="special">(</span><span class="string">"caught runtime error or derived\n"</span><span class="special">)</span> +<span class="special">]</span> +<span class="special">.</span><span class="identifier">catch_</span><span class="special"><</span><span class="identifier">exception</span><span class="special">>()</span> +<span class="special">[</span> + <span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">val</span><span class="special">(</span><span class="string">"caught exception or derived\n"</span><span class="special">)</span> +<span class="special">]</span> +<span class="special">.</span><span class="identifier">catch_all</span> +<span class="special">[</span> + <span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">val</span><span class="special">(</span><span class="string">"caught some other type of exception\n"</span><span class="special">)</span> +<span class="special">]</span> +</pre> +</div> +<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> +<td align="left"></td> +<td align="right"><div class="copyright-footer">Copyright © 2002-2005, 2010 Joel de Guzman, Dan Marsden, Thomas Heller<p> + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>) + </p> +</div></td> +</tr></table> +<hr> +<div class="spirit-nav"> +<a accesskey="p" href="for_statement.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../statement.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="throw_.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a> +</div> +</body> +</html> diff --git a/libs/phoenix/doc/html/phoenix/modules/statement/while__statement.html b/libs/phoenix/doc/html/phoenix/modules/statement/while__statement.html new file mode 100644 index 0000000000..1668aa7804 --- /dev/null +++ b/libs/phoenix/doc/html/phoenix/modules/statement/while__statement.html @@ -0,0 +1,69 @@ +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> +<title>while_ Statement</title> +<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css"> +<meta name="generator" content="DocBook XSL Stylesheets V1.76.1"> +<link rel="home" href="../../../index.html" title="Chapter 1. Phoenix 3.0"> +<link rel="up" href="../statement.html" title="Statement"> +<link rel="prev" href="switch__statement.html" title="switch_ Statement"> +<link rel="next" href="___do_while_____statement.html" title="do_while_ Statement"> +</head> +<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> +<table cellpadding="2" width="100%"><tr> +<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td> +<td align="center"><a href="../../../../../../../index.html">Home</a></td> +<td align="center"><a href="../../../../../../../libs/libraries.htm">Libraries</a></td> +<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td> +<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td> +<td align="center"><a href="../../../../../../../more/index.htm">More</a></td> +</tr></table> +<hr> +<div class="spirit-nav"> +<a accesskey="p" href="switch__statement.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../statement.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="___do_while_____statement.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a> +</div> +<div class="section"> +<div class="titlepage"><div><div><h4 class="title"> +<a name="phoenix.modules.statement.while__statement"></a><a class="link" href="while__statement.html" title="while_ Statement">while_ + Statement</a> +</h4></div></div></div> +<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">phoenix</span><span class="special">/</span><span class="identifier">statement</span><span class="special">/</span><span class="keyword">while</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span> +</pre> +<p> + The syntax is: + </p> +<pre class="programlisting"><span class="identifier">while_</span><span class="special">(</span><span class="identifier">conditional_expression</span><span class="special">)</span> +<span class="special">[</span> + <span class="identifier">sequenced_statements</span> +<span class="special">]</span> +</pre> +<p> + Example: This code decrements each element until it reaches zero and prints + out the number at each step. A newline terminates the printout of each + value. + </p> +<pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">for_each</span><span class="special">(</span><span class="identifier">c</span><span class="special">.</span><span class="identifier">begin</span><span class="special">(),</span> <span class="identifier">c</span><span class="special">.</span><span class="identifier">end</span><span class="special">(),</span> + <span class="special">(</span> + <span class="identifier">while_</span><span class="special">(</span><span class="identifier">arg1</span><span class="special">--)</span> + <span class="special">[</span> + <span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">arg1</span> <span class="special"><<</span> <span class="string">", "</span> + <span class="special">],</span> + <span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">val</span><span class="special">(</span><span class="string">"\n"</span><span class="special">)</span> + <span class="special">)</span> +<span class="special">);</span> +</pre> +</div> +<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> +<td align="left"></td> +<td align="right"><div class="copyright-footer">Copyright © 2002-2005, 2010 Joel de Guzman, Dan Marsden, Thomas Heller<p> + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>) + </p> +</div></td> +</tr></table> +<hr> +<div class="spirit-nav"> +<a accesskey="p" href="switch__statement.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../statement.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="___do_while_____statement.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a> +</div> +</body> +</html> |