]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | <?xml version="1.0" encoding="utf-8"?> |
2 | <!-- | |
3 | Copyright 2012 Eric Niebler | |
4 | ||
5 | Distributed under the Boost | |
6 | Software License, Version 1.0. (See accompanying | |
7 | file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | |
8 | --> | |
9 | <header name="boost/proto/proto_typeof.hpp"> | |
10 | <para>Boost.Typeof registrations for Proto's types, and definition of the | |
11 | <computeroutput><macroname>BOOST_PROTO_AUTO</macroname>()</computeroutput> macro.</para> | |
12 | <macro name="BOOST_PROTO_AUTO" kind="functionlike"> | |
13 | <macro-parameter name="Var"/> | |
14 | <macro-parameter name="Expr"/> | |
15 | <purpose>For defining a local variable that stores a Proto expression template, | |
16 | deep-copying the expression so there are no dangling references.</purpose> | |
17 | <description> | |
18 | <para> | |
19 | To define a local variable <computeroutput>ex</computeroutput> that stores the expression | |
20 | <computeroutput><functionname alt="boost::proto::lit">proto::lit</functionname>(1) + 2</computeroutput>, | |
21 | do the following:<programlisting>BOOST_PROTO_AUTO( ex, <functionname alt="boost::proto::lit">proto::lit</functionname>(1) + 2 );</programlisting>. | |
22 | The above is equivalent to the following: | |
23 | <programlisting>BOOST_AUTO( ex, <functionname alt="boost::proto::deep_copy">proto::deep_copy</functionname>( <functionname alt="boost::proto::lit">proto::lit</functionname>(1) + 2 ) );</programlisting> | |
24 | </para> | |
25 | </description> | |
26 | </macro> | |
27 | </header> |