proto_typeof.xml 1.4 KB

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