Files
boost_preprocessor/doc/reference/list_fold_left.htm
Vesa Karvonen 3b7418f9ce Working on docs
[SVN r12612]
2002-01-31 21:52:46 +00:00

56 lines
1.8 KiB
HTML

<HTML><HEAD><TITLE>Boost PREPROCESSOR library</TITLE><BODY bgcolor="#FFFFFF">
<a href="index.htm"><IMG height=86 alt="c++boost.gif (8819 bytes)" src="../../../../c++boost.gif" width=277 align=center></a>
<hr>
<H1>#include &lt;<a href="../../../../boost/preprocessor/list/fold_left.hpp">boost/preprocessor/list/fold_left.hpp</a>&gt;</H1>
<hr>
<H2><a name="BOOST_PP_LIST_FOLD_LEFT">#define BOOST_PP_LIST_FOLD_LEFT</a>(F,P,L)</H2>
<P>Iterates F(D,P,X) for each element X of the list L (from the left or the start of the list).</P>
<P>In other words,</P>
<PRE>
<a href="list_fold_left.htm#BOOST_PP_LIST_FOLD_LEFT">BOOST_PP_LIST_FOLD_LEFT</a>(F,P,L)
</PRE>
<P>expands to:</P>
<PRE>
F
( D
, ... F(D, F(D,P,<a href="list_at.htm#BOOST_PP_LIST_AT">BOOST_PP_LIST_AT</a>(L,0)), <a href="list_at.htm#BOOST_PP_LIST_AT">BOOST_PP_LIST_AT</a>(L,1)) ...
, <a href="list_at.htm#BOOST_PP_LIST_AT">BOOST_PP_LIST_AT</a>(L,<a href="dec.htm#BOOST_PP_DEC">BOOST_PP_DEC</a>(<a href="list_size.htm#BOOST_PP_LIST_SIZE">BOOST_PP_LIST_SIZE</a>(L))
)
</PRE>
<H3>Note</H3>
<P>Folding, or accumulation, is a very general pattern of computation.
Most list operations can be implemented in terms of folding.</P>
<H3>See</H3>
<UL>
<LI><a href="list_fold_right.htm#BOOST_PP_LIST_FOLD_RIGHT">BOOST_PP_LIST_FOLD_RIGHT</a>()
</UL>
<H3>Uses</H3>
<UL>
<LI><a href="while.htm#BOOST_PP_WHILE">BOOST_PP_WHILE</a>()
</UL>
<hr>
<p>(C) Copyright Housemarque Oy 2002</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>
</BODY></HTML>