list_to_array.html 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <html>
  2. <head>
  3. <meta content="text/html; charset=windows-1252" http-equiv="content-type">
  4. <title>BOOST_PP_LIST_TO_ARRAY</title>
  5. <link rel="stylesheet" type="text/css" href="../styles.css">
  6. </head>
  7. <body>
  8. <div style="margin-left: 0px;"> The <b>BOOST_PP_LIST_TO_ARRAY</b> macro
  9. converts a <i>list</i> to an <i>array</i>. </div>
  10. <h4> Usage </h4>
  11. <div class="code"> <b>BOOST_PP_LIST_TO_ARRAY</b>(<i>list</i>) </div>
  12. <h4> Arguments </h4>
  13. <dl>
  14. <dt>list</dt>
  15. <dd> The <i>list</i> to be converted. <br>
  16. </dd>
  17. </dl>
  18. <h4>Remarks</h4>
  19. <div> This macro uses <b>BOOST_PP_WHILE</b>. Within <b>BOOST_PP_WHILE</b>,
  20. it is more efficient to use <b>BOOST_PP_LIST_TO_ARRAY_D</b>.<br>
  21. <br>
  22. If the <i>list</i> to be converted is empty, as represented by
  23. 'BOOST_PP_NIL', the resulting <i>array</i> is empty, as represented by '( 0, ()
  24. )'.</div>
  25. <h4>See Also</h4>
  26. <ul>
  27. <li><a href="list_to_array_d.html">BOOST_PP_LIST_TO_ARRAY_D</a></li>
  28. </ul>
  29. <h4> Requirements </h4>
  30. <div> <b>Header:</b> &nbsp;<a href="../headers/list/to_array.html">&lt;boost/preprocessor/list/to_array.hpp&gt;</a>
  31. </div>
  32. <h4> Sample Code </h4>
  33. <div>
  34. <pre>#include &lt;<a href="../headers/list/to_array.html">boost/preprocessor/list/to_array.hpp</a>&gt;<br><br>#define LIST (a, (b, (c, <a
  35. href="nil.html">BOOST_PP_NIL</a>)))<br><br><a href="list_to_array.html">BOOST_PP_LIST_TO_ARRAY</a>(LIST) // expands to (3, (a, b, c))</pre>
  36. </div>
  37. <hr size="1">
  38. <div style="margin-left: 0px;"> <i></i><i>© Copyright Edward Diener 2011</i>
  39. </div>
  40. <div style="margin-left: 0px;">
  41. <p><small>Distributed under the Boost Software License, Version 1.0. (See
  42. accompanying file <a href="../../../../LICENSE_1_0.txt">LICENSE_1_0.txt</a>
  43. or copy at <a href="http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt</a>)</small></p>
  44. </div>
  45. </body>
  46. </html>