Files
preprocessor/doc/reference/adt_8hpp.html
Vesa Karvonen 178a8ab429 Added list data structure
[SVN r12433]
2002-01-22 10:29:42 +00:00

245 lines
8.8 KiB
HTML
Raw Blame History

<a href="../index.htm"><IMG height=86
alt="c++boost.gif (8819 bytes)"
src="../../../../c++boost.gif"
width=277 align=center></a>
<hr>
<!-- Generated by Doxygen 1.2.13 -->
<center>
<a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="globals.html">File Members</a> &nbsp; </center>
<hr><h1>adt.hpp File Reference</h1><table border=0 cellpadding=0 cellspacing=0>
<tr><td colspan=2><br><h2>Defines</h2></td></tr>
<tr><td nowrap align=right valign=top>#define&nbsp;</td><td valign=bottom><a class="el" href="adt_8hpp.html#a0">BOOST_PP_LIST_CONS</a>(H, T)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>List constructor.</em> <a href="#a0">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>#define&nbsp;</td><td valign=bottom><a class="el" href="adt_8hpp.html#a1">BOOST_PP_LIST_NIL</a></td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>List nil constructor.</em> <a href="#a1">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>#define&nbsp;</td><td valign=bottom><a class="el" href="adt_8hpp.html#a2">BOOST_PP_LIST_IS_CONS</a>(L)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Expands to 1 if the list is not nil and 0 otherwise.</em> <a href="#a2">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>#define&nbsp;</td><td valign=bottom><a class="el" href="adt_8hpp.html#a3">BOOST_PP_LIST_IS_NIL</a>(L)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Expands to 1 if the list is nil and 0 otherwise.</em> <a href="#a3">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>#define&nbsp;</td><td valign=bottom><a class="el" href="adt_8hpp.html#a4">BOOST_PP_LIST_FIRST</a>(L)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Expands to the first element of the list. The list must not be nil.</em> <a href="#a4">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>#define&nbsp;</td><td valign=bottom><a class="el" href="adt_8hpp.html#a5">BOOST_PP_LIST_REST</a>(L)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Expands to a list of all but the first element of the list. The list must not be nil.</em> <a href="#a5">More...</a><em></em></font><br><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
<a href="../../../../boost/preprocessor/list/adt.hpp">Click here to see the header.</a>
<p>
This header defines the fundamental list operations.
<p>
NOTE: The internal representation of lists is hidden. Although there aren't compelling reasons to change the representation, you should avoid writing code that depends on the internal representation details.
<p>
<hr><h2>Define Documentation</h2>
<a name="a0" doxytag="adt.hpp::BOOST_PP_LIST_CONS"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> #define BOOST_PP_LIST_CONS</td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">H, <tr>
<td></td>
<td></td>
<td class="md" nowrap>T&nbsp;</td>
<td class="mdname1" valign="top" nowrap>&nbsp; </td>
<td class="md" valign="top">)&nbsp;</td>
<td class="md" nowrap>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
List constructor.
<p>
Lists are build using list constructors BOOST_PP_LIST_NIL and <a class="el" href="adt_8hpp.html#a0">BOOST_PP_LIST_CONS</a>(). For example,
<p>
<pre><div class="fragment"><pre>
BOOST_PP_LIST_CONS(1,
BOOST_PP_LIST_CONS(2,
BOOST_PP_LIST_CONS(3,
BOOST_PP_LIST_CONS(4,
BOOST_PP_LIST_CONS(5,
BOOST_PP_LIST_NIL)))))
</pre></div></pre>
<p>
Short lists can also be build from tuples:
<p>
<pre><div class="fragment"><pre>
BOOST_PP_TUPLE_TO_LIST(5,(1,2,3,4,5))
</pre></div></pre>
<p>
Both of the above lists contain 5 elements: 1, 2, 3, 4 and 5. </td>
</tr>
</table>
<a name="a4" doxytag="adt.hpp::BOOST_PP_LIST_FIRST"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> #define BOOST_PP_LIST_FIRST</td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">L&nbsp;</td>
<td class="mdname1" valign="top" nowrap>&nbsp; </td>
<td class="md" valign="top">)&nbsp;</td>
<td class="md" nowrap>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Expands to the first element of the list. The list must not be nil.
<p>
For example,
<p>
<pre><div class="fragment"><pre>
BOOST_PP_LIST_FIRST(BOOST_PP_TUPLE_TO_LIST(5,(1,2,3,4,5)))
</pre></div></pre>
<p>
expands to 1.
<p>
See <a class="el" href="adt_8hpp.html#a5">BOOST_PP_LIST_REST</a>(). </td>
</tr>
</table>
<a name="a2" doxytag="adt.hpp::BOOST_PP_LIST_IS_CONS"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> #define BOOST_PP_LIST_IS_CONS</td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">L&nbsp;</td>
<td class="mdname1" valign="top" nowrap>&nbsp; </td>
<td class="md" valign="top">)&nbsp;</td>
<td class="md" nowrap>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Expands to 1 if the list is not nil and 0 otherwise.
<p>
See <a class="el" href="adt_8hpp.html#a3">BOOST_PP_LIST_IS_NIL</a>(). </td>
</tr>
</table>
<a name="a3" doxytag="adt.hpp::BOOST_PP_LIST_IS_NIL"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> #define BOOST_PP_LIST_IS_NIL</td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">L&nbsp;</td>
<td class="mdname1" valign="top" nowrap>&nbsp; </td>
<td class="md" valign="top">)&nbsp;</td>
<td class="md" nowrap>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Expands to 1 if the list is nil and 0 otherwise.
<p>
See <a class="el" href="adt_8hpp.html#a2">BOOST_PP_LIST_IS_CONS</a>(). </td>
</tr>
</table>
<a name="a1" doxytag="adt.hpp::BOOST_PP_LIST_NIL"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> #define BOOST_PP_LIST_NIL
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
List nil constructor.
<p>
See <a class="el" href="adt_8hpp.html#a0">BOOST_PP_LIST_CONS</a>(). </td>
</tr>
</table>
<a name="a5" doxytag="adt.hpp::BOOST_PP_LIST_REST"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> #define BOOST_PP_LIST_REST</td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">L&nbsp;</td>
<td class="mdname1" valign="top" nowrap>&nbsp; </td>
<td class="md" valign="top">)&nbsp;</td>
<td class="md" nowrap>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Expands to a list of all but the first element of the list. The list must not be nil.
<p>
For example,
<p>
<pre><div class="fragment"><pre>
BOOST_PP_LIST_REST(BOOST_PP_TUPLE_TO_LIST(5,(1,2,3,4,5)))
</pre></div></pre>
<p>
expands to a list containing 2, 3, 4 and 5.
<p>
See <a class="el" href="adt_8hpp.html#a4">BOOST_PP_LIST_FIRST</a>(). </td>
</tr>
</table>
<hr>
<p><EFBFBD> Copyright Housemarque Oy 2001</p>
<p>Permission to copy, use, modify, sell and distribute this document is granted
provided this copyright notice appears in all copies. This document is provided
"as is" without express or implied warranty, and with no claim as to its suitability
for any purpose. </p>
<p>Generated: <!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %b %Y" startspan --><!--webbot bot="Timestamp" endspan i-checksum="15246" --></p>