Imported Upstream version 1.51.0
[platform/upstream/boost.git] / doc / html / boost / proto / as_child_id1550862.html
1 <html>
2 <head>
3 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4 <title>Function as_child</title>
5 <link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css">
6 <meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
7 <link rel="home" href="../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
8 <link rel="up" href="../../proto/reference.html#header.boost.proto.traits_hpp" title="Header &lt;boost/proto/traits.hpp&gt;">
9 <link rel="prev" href="as_expr_id1550672.html" title="Function as_expr">
10 <link rel="next" href="child_id1551053.html" title="Function child">
11 </head>
12 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
13 <table cellpadding="2" width="100%"><tr>
14 <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td>
15 <td align="center"><a href="../../../../index.html">Home</a></td>
16 <td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td>
17 <td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
18 <td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
19 <td align="center"><a href="../../../../more/index.htm">More</a></td>
20 </tr></table>
21 <hr>
22 <div class="spirit-nav">
23 <a accesskey="p" href="as_expr_id1550672.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../proto/reference.html#header.boost.proto.traits_hpp"><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="child_id1551053.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
24 </div>
25 <div class="refentry">
26 <a name="boost.proto.as_child_id1550862"></a><div class="titlepage"></div>
27 <div class="refnamediv">
28 <h2><span class="refentrytitle">Function as_child</span></h2>
29 <p>boost::proto::as_child &#8212; A function that wraps non-Proto objects in Proto terminals (by reference) and leaves
30           Proto expression types alone.</p>
31 </div>
32 <h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
33 <div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../proto/reference.html#header.boost.proto.traits_hpp" title="Header &lt;boost/proto/traits.hpp&gt;">boost/proto/traits.hpp</a>&gt;
34
35 </span>
36 <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span> 
37   <span class="keyword">typename</span> <a class="link" href="result_of/as_child.html" title="Struct template as_child">proto::result_of::as_child</a><span class="special">&lt;</span> <span class="identifier">T</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">type</span> <span class="identifier">as_child</span><span class="special">(</span><span class="identifier">T</span> <span class="special">&amp;</span> t<span class="special">)</span><span class="special">;</span>
38 <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span> 
39   <span class="keyword">typename</span> <a class="link" href="result_of/as_child.html" title="Struct template as_child">proto::result_of::as_child</a><span class="special">&lt;</span> <span class="identifier">T</span> <span class="keyword">const</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">type</span> <span class="identifier">as_child</span><span class="special">(</span><span class="identifier">T</span> <span class="keyword">const</span> <span class="special">&amp;</span> t<span class="special">)</span><span class="special">;</span>
40 <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <a class="link" href="../../Domain.html" title="Concept Domain">Domain</a><span class="special">,</span> <span class="keyword">typename</span> T<span class="special">&gt;</span> 
41   <span class="keyword">typename</span> <a class="link" href="result_of/as_child.html" title="Struct template as_child">proto::result_of::as_child</a><span class="special">&lt;</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">Domain</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">type</span> <span class="identifier">as_child</span><span class="special">(</span><span class="identifier">T</span> <span class="special">&amp;</span> t<span class="special">)</span><span class="special">;</span>
42 <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <a class="link" href="../../Domain.html" title="Concept Domain">Domain</a><span class="special">,</span> <span class="keyword">typename</span> T<span class="special">&gt;</span> 
43   <span class="keyword">typename</span> <a class="link" href="result_of/as_child.html" title="Struct template as_child">proto::result_of::as_child</a><span class="special">&lt;</span> <span class="identifier">T</span> <span class="keyword">const</span><span class="special">,</span> <span class="identifier">Domain</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">type</span> 
44   <span class="identifier">as_child</span><span class="special">(</span><span class="identifier">T</span> <span class="keyword">const</span> <span class="special">&amp;</span> t<span class="special">)</span><span class="special">;</span></pre></div>
45 <div class="refsect1">
46 <a name="id2896431"></a><h2>Description</h2>
47 <p>
48             The <code class="computeroutput">proto::as_child()</code> function returns Proto expression
49             objects that are suitable for storage as child nodes in an expression tree. It turns
50             non-Proto objects into Proto terminals. Its behavior is domain-specific. By default,
51             non-Proto types are held wrapped by reference in a new Proto terminal expression, and
52             objects that are already Proto expressions are simply returned by reference.
53           </p>
54 <p>
55             If <code class="computeroutput">Domain</code> is not explicitly specified, it is assumed to
56             be <code class="computeroutput"><code class="computeroutput"><a class="link" href="default_domain.html" title="Struct default_domain">proto::default_domain</a></code></code>.
57           </p>
58 <p>
59             See <code class="computeroutput"><code class="computeroutput"><a class="link" href="domain/as_child.html" title="Struct template as_child">proto::domain::as_child</a></code>&lt;&gt;</code>
60             for a complete description of this function's default behavior.
61           </p>
62 <div class="variablelist"><table border="0">
63 <col align="left" valign="top">
64 <tbody><tr>
65 <td><p><span class="term">Returns:</span></p></td>
66 <td><code class="computeroutput">typename Domain::template as_child&lt; T &gt;()(t)</code></td>
67 </tr></tbody>
68 </table></div>
69 </div>
70 </div>
71 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
72 <td align="left"></td>
73 <td align="right"><div class="copyright-footer">Copyright &#169; 2008 Eric Niebler<p>
74         Distributed under the Boost Software License, Version 1.0. (See accompanying
75         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>)
76       </p>
77 </div></td>
78 </tr></table>
79 <hr>
80 <div class="spirit-nav">
81 <a accesskey="p" href="as_expr_id1550672.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../proto/reference.html#header.boost.proto.traits_hpp"><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="child_id1551053.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
82 </div>
83 </body>
84 </html>