forked from boostorg/preprocessor
initial revision
[SVN r15202]
This commit is contained in:
@ -1,108 +0,0 @@
|
||||
#ifndef BOOST_PREPROCESSOR_LIST_ADT_HPP
|
||||
#define BOOST_PREPROCESSOR_LIST_ADT_HPP
|
||||
|
||||
/* Copyright (C) 2001
|
||||
* Housemarque Oy
|
||||
* http://www.housemarque.com
|
||||
*
|
||||
* Permission to copy, use, modify, sell and distribute this software is
|
||||
* granted provided this copyright notice appears in all copies. This
|
||||
* software is provided "as is" without express or implied warranty, and
|
||||
* with no claim as to its suitability for any purpose.
|
||||
*
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
/** <p>This header defines the fundamental list operations.</p>
|
||||
|
||||
<h3>Note</h3>
|
||||
<ul>
|
||||
<li>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.</li>
|
||||
</ul>
|
||||
*/
|
||||
|
||||
#include <boost/preprocessor/tuple/elem.hpp>
|
||||
#include <boost/preprocessor/logical/not.hpp>
|
||||
|
||||
/** <p>List constructor.</p>
|
||||
|
||||
<p>Lists are build using list constructors BOOST_PP_LIST_NIL and
|
||||
BOOST_PP_LIST_CONS(). For example,</p>
|
||||
|
||||
<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>
|
||||
|
||||
<p>Short lists can also be build from tuples:</p>
|
||||
|
||||
<pre>
|
||||
BOOST_PP_TUPLE_TO_LIST(5,(1,2,3,4,5))
|
||||
</pre>
|
||||
|
||||
<p>Both of the above lists contain 5 elements: 1, 2, 3, 4 and 5.</p>
|
||||
|
||||
<p>Longer lists can be built from short lists with BOOST_PP_LIST_APPEND_D()
|
||||
and BOOST_PP_LIST_FOLD_RIGHT():</p>
|
||||
|
||||
<pre>
|
||||
BOOST_PP_LIST_FOLD_RIGHT
|
||||
( BOOST_PP_LIST_APPEND_D
|
||||
, BOOST_PP_TUPLE_TO_LIST
|
||||
( N
|
||||
, BOOST_PP_TUPLE_TO_LIST(M, (E11, E12, ..., E1M) )
|
||||
, BOOST_PP_TUPLE_TO_LIST(M, (E21, E22, ..., E2M) )
|
||||
, ...
|
||||
, BOOST_PP_TUPLE_TO_LIST(M, (EN1, EN2, ..., ENM) )
|
||||
)
|
||||
, BOOST_PP_LIST_NIL
|
||||
)
|
||||
</pre>
|
||||
*/
|
||||
#define BOOST_PP_LIST_CONS(FIRST,REST) (FIRST,REST,1)
|
||||
|
||||
/** <p>List nil constructor.</p> */
|
||||
#define BOOST_PP_LIST_NIL (_,_,0)
|
||||
|
||||
/** <p>Expands to 1 if the list is not nil and 0 otherwise.</p> */
|
||||
#define BOOST_PP_LIST_IS_CONS(LIST) BOOST_PP_TUPLE_ELEM(3,2,LIST)
|
||||
|
||||
/** <p>Expands to 1 if the list is nil and 0 otherwise.</p> */
|
||||
#define BOOST_PP_LIST_IS_NIL(LIST) BOOST_PP_NOT(BOOST_PP_TUPLE_ELEM(3,2,LIST))
|
||||
|
||||
/** <p>Expands to the first element of the list. The list must not be nil.</p>
|
||||
|
||||
<p>For example,</p>
|
||||
|
||||
<pre>
|
||||
BOOST_PP_LIST_FIRST(BOOST_PP_TUPLE_TO_LIST(5,(1,2,3,4,5)))
|
||||
</pre>
|
||||
|
||||
<p>expands to 1.</p>
|
||||
*/
|
||||
#define BOOST_PP_LIST_FIRST(LIST) BOOST_PP_TUPLE_ELEM(3,0,LIST)
|
||||
|
||||
/** <p>Expands to a list of all but the first element of the list.</p>
|
||||
|
||||
<p>The list must not be nil.</p>
|
||||
|
||||
<p>For example,</p>
|
||||
|
||||
<pre>
|
||||
BOOST_PP_LIST_REST(BOOST_PP_TUPLE_TO_LIST(5,(1,2,3,4,5)))
|
||||
</pre>
|
||||
|
||||
<p>expands to the same as:</p>
|
||||
|
||||
<pre>
|
||||
BOOST_PP_TUPLE_TO_LIST(4,(2,3,4,5))
|
||||
</pre>
|
||||
*/
|
||||
#define BOOST_PP_LIST_REST(LIST) BOOST_PP_TUPLE_ELEM(3,1,LIST)
|
||||
#endif
|
@ -1,45 +0,0 @@
|
||||
#ifndef BOOST_PREPROCESSOR_LIST_APPEND_HPP
|
||||
#define BOOST_PREPROCESSOR_LIST_APPEND_HPP
|
||||
|
||||
/* Copyright (C) 2001
|
||||
* Housemarque Oy
|
||||
* http://www.housemarque.com
|
||||
*
|
||||
* Permission to copy, use, modify, sell and distribute this software is
|
||||
* granted provided this copyright notice appears in all copies. This
|
||||
* software is provided "as is" without express or implied warranty, and
|
||||
* with no claim as to its suitability for any purpose.
|
||||
*
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
#include <boost/preprocessor/list/fold_right.hpp>
|
||||
|
||||
/** <p>Catenates two lists together.</p>
|
||||
|
||||
<p>For example,</p>
|
||||
|
||||
<pre>
|
||||
BOOST_PP_LIST_APPEND
|
||||
( BOOST_PP_TUPLE_TO_LIST(2,(1,2))
|
||||
, BOOST_PP_TUPLE_TO_LIST(2,(3,4))
|
||||
)
|
||||
</pre>
|
||||
|
||||
<p>expands to the same as:</p>
|
||||
|
||||
<pre>
|
||||
BOOST_PP_TUPLE_TO_LIST(4,(1,2,3,4))
|
||||
</pre>
|
||||
|
||||
<h3>Test</h3>
|
||||
<ul>
|
||||
<li><a href="../../test/list_test.cpp">list_test.cpp</a></li>
|
||||
</ul>
|
||||
*/
|
||||
#define BOOST_PP_LIST_APPEND(LIST_1ST,LIST_2ND) BOOST_PP_LIST_APPEND_D(0,LIST_1ST,LIST_2ND)
|
||||
|
||||
/** <p>Can be used inside BOOST_PP_WHILE() (see for an explanation of the D parameter).</p> */
|
||||
#define BOOST_PP_LIST_APPEND_D(D,LIST_1ST,LIST_2ND) BOOST_PP_LIST_FOLD_RIGHT_D(D,BOOST_PP_LIST_APPEND_F,LIST_1ST,LIST_2ND)
|
||||
#define BOOST_PP_LIST_APPEND_F(D,X,S) (X,S,1)
|
||||
#endif
|
@ -1,38 +0,0 @@
|
||||
#ifndef BOOST_PFIRST_NPROCESSOR_LIST_AT_HPP
|
||||
#define BOOST_PFIRST_NPROCESSOR_LIST_AT_HPP
|
||||
|
||||
/* Copyright (C) 2001
|
||||
* Housemarque Oy
|
||||
* http://www.housemarque.com
|
||||
*
|
||||
* Permission to copy, use, modify, sell and distribute this softwaFIRST_N is
|
||||
* granted provided this copyright notice appears in all copies. This
|
||||
* software is provided "as is" without express or implied warranty, and
|
||||
* with no claim as to its suitability for any purpose.
|
||||
*
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
#include <boost/preprocessor/list/rest_n.hpp>
|
||||
|
||||
/** <p>Expands to the <code>INDEX</code>:th element of the list <code>LIST</code>. The
|
||||
first element is at index <code>0</code>.</p>
|
||||
|
||||
<p>For example,</p>
|
||||
|
||||
<pre>
|
||||
BOOST_PP_LIST_AT(BOOST_PP_TUPLE_TO_LIST(3,(A,B,C)),1)
|
||||
</pre>
|
||||
|
||||
<p>expands to <code>B</code>.</p>
|
||||
|
||||
<h3>Test</h3>
|
||||
<ul>
|
||||
<li><a href="../../test/list_test.cpp">list_test.cpp</a></li>
|
||||
</ul>
|
||||
*/
|
||||
#define BOOST_PP_LIST_AT(LIST,INDEX) BOOST_PP_LIST_AT_D(0,LIST,INDEX)
|
||||
|
||||
/** <p>Can be used inside BOOST_PP_WHILE() (see for an explanation of the D parameter).</p> */
|
||||
#define BOOST_PP_LIST_AT_D(D,LIST,INDEX) BOOST_PP_LIST_FIRST(BOOST_PP_LIST_REST_N_D(D,INDEX,LIST))
|
||||
#endif
|
@ -1,43 +0,0 @@
|
||||
#ifndef BOOST_PREPROCESSOR_LIST_CAT_HPP
|
||||
#define BOOST_PREPROCESSOR_LIST_CAT_HPP
|
||||
|
||||
/* Copyright (C) 2001
|
||||
* Housemarque Oy
|
||||
* http://www.housemarque.com
|
||||
*
|
||||
* Permission to copy, use, modify, sell and distribute this software is
|
||||
* granted provided this copyright notice appears in all copies. This
|
||||
* software is provided "as is" without express or implied warranty, and
|
||||
* with no claim as to its suitability for any purpose.
|
||||
*
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
#include <boost/preprocessor/list/fold_left.hpp>
|
||||
|
||||
/** <p>Catenates all elements of the list.</p>
|
||||
|
||||
<p>For example,</p>
|
||||
|
||||
<pre>
|
||||
BOOST_PP_LIST_CAT(BOOST_PP_TUPLE_TO_LIST(3,(1,2,3)))
|
||||
</pre>
|
||||
|
||||
<p>expands to:</p>
|
||||
|
||||
<pre>
|
||||
123
|
||||
</pre>
|
||||
|
||||
<h3>Test</h3>
|
||||
<ul>
|
||||
<li><a href="../../test/list_test.cpp">list_test.cpp</a></li>
|
||||
</ul>
|
||||
*/
|
||||
#define BOOST_PP_LIST_CAT(LIST) BOOST_PP_LIST_CAT_D(0,LIST)
|
||||
|
||||
/** <p>Can be used inside BOOST_PP_WHILE() (see for an explanation of the D parameter).</p> */
|
||||
#define BOOST_PP_LIST_CAT_D(D,LIST) BOOST_PP_LIST_FOLD_LEFT_D(D,BOOST_PP_LIST_CAT_F,BOOST_PP_TUPLE_ELEM(3,0,LIST),BOOST_PP_TUPLE_ELEM(3,1,LIST))
|
||||
#define BOOST_PP_LIST_CAT_F(D,S,X) BOOST_PP_CAT(S,X)
|
||||
#endif
|
@ -1,43 +0,0 @@
|
||||
#ifndef BOOST_PREPROCESSOR_LIST_ENUM_HPP
|
||||
#define BOOST_PREPROCESSOR_LIST_ENUM_HPP
|
||||
|
||||
/* Copyright (C) 2001
|
||||
* Housemarque Oy
|
||||
* http://www.housemarque.com
|
||||
*
|
||||
* Permission to copy, use, modify, sell and distribute this software is
|
||||
* granted provided this copyright notice appears in all copies. This
|
||||
* software is provided "as is" without express or implied warranty, and
|
||||
* with no claim as to its suitability for any purpose.
|
||||
*
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
#include <boost/preprocessor/comma_if.hpp>
|
||||
#include <boost/preprocessor/list/for_each_i.hpp>
|
||||
|
||||
/** <p>Converts the list to a comma separated list.</p>
|
||||
|
||||
<p>For example,</p>
|
||||
|
||||
<pre>
|
||||
BOOST_PP_LIST_ENUM(BOOST_PP_TUPLE_TO_LIST(3,(A,B,C)))
|
||||
</pre>
|
||||
|
||||
<p>expands to:</p>
|
||||
|
||||
<pre>
|
||||
A,B,C
|
||||
</pre>
|
||||
|
||||
<h3>Uses</h3>
|
||||
<ul>
|
||||
<li>BOOST_PP_LIST_FOR_EACH_I()</li>
|
||||
</ul>
|
||||
*/
|
||||
#define BOOST_PP_LIST_ENUM(LIST) BOOST_PP_LIST_ENUM_R(0,LIST)
|
||||
|
||||
/** <p>Can be used inside BOOST_PP_FOR() (see for an explanation of the R parameter).</p> */
|
||||
#define BOOST_PP_LIST_ENUM_R(R,LIST) BOOST_PP_LIST_FOR_EACH_I_R(R,BOOST_PP_LIST_ENUM_F,_,LIST)
|
||||
#define BOOST_PP_LIST_ENUM_F(R,_,I,X) BOOST_PP_COMMA_IF(I) X
|
||||
#endif
|
@ -1,44 +0,0 @@
|
||||
#ifndef BOOST_PREPROCESSOR_LIST_FILTER_HPP
|
||||
#define BOOST_PREPROCESSOR_LIST_FILTER_HPP
|
||||
|
||||
/* Copyright (C) 2001
|
||||
* Housemarque Oy
|
||||
* http://www.housemarque.com
|
||||
*
|
||||
* Permission to copy, use, modify, sell and distribute this software is
|
||||
* granted provided this copyright notice appears in all copies. This
|
||||
* software is provided "as is" without express or implied warranty, and
|
||||
* with no claim as to its suitability for any purpose.
|
||||
*
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
#include <boost/preprocessor/list/fold_right.hpp>
|
||||
|
||||
/** <p>Expands to a list containing all the elements <code>X</code> of the list
|
||||
for which <code>PRED(D,DATA,X)</code> is true.</p>
|
||||
|
||||
<p>For example,</p>
|
||||
|
||||
<pre>
|
||||
BOOST_PP_LIST_FILTER(BOOST_PP_NOT_EQUAL_D,2,BOOST_PP_TUPLE_TO_LIST(3,(1,2,3)))
|
||||
</pre>
|
||||
|
||||
<p>expands to the same as:</p>
|
||||
|
||||
<pre>
|
||||
BOOST_PP_TUPLE_TO_LIST(2,(1,3))
|
||||
</pre>
|
||||
|
||||
<h3>Test</h3>
|
||||
<ul>
|
||||
<li><a href="../../test/list_test.cpp">list_test.cpp</a></li>
|
||||
</ul>
|
||||
*/
|
||||
#define BOOST_PP_LIST_FILTER(PRED,DATA,LIST) BOOST_PP_LIST_FILTER_D(0,PRED,DATA,LIST)
|
||||
|
||||
/** <p>Can be used inside BOOST_PP_WHILE() (see for an explanation of the D parameter).</p> */
|
||||
#define BOOST_PP_LIST_FILTER_D(D,PRED,DATA,LIST) BOOST_PP_TUPLE_ELEM(3,2,BOOST_PP_LIST_FOLD_RIGHT_D(D,BOOST_PP_LIST_FILTER_F,LIST,(PRED,DATA,(_,_,0))))
|
||||
|
||||
#define BOOST_PP_LIST_FILTER_F(D,X,PDR) (BOOST_PP_TUPLE_ELEM(3,0,PDR),BOOST_PP_TUPLE_ELEM(3,1,PDR),BOOST_PP_IF(BOOST_PP_TUPLE_ELEM(3,0,PDR)(D,BOOST_PP_TUPLE_ELEM(3,1,PDR),X),BOOST_PP_LIST_CONS,BOOST_PP_IF1)(X,BOOST_PP_TUPLE_ELEM(3,2,PDR)))
|
||||
#endif
|
@ -1,53 +0,0 @@
|
||||
#ifndef BOOST_PREPROCESSOR_LIST_FIRST_N_HPP
|
||||
#define BOOST_PREPROCESSOR_LIST_FIRST_N_HPP
|
||||
|
||||
/* Copyright (C) 2001
|
||||
* Housemarque Oy
|
||||
* http://www.housemarque.com
|
||||
*
|
||||
* Permission to copy, use, modify, sell and distribute this software is
|
||||
* granted provided this copyright notice appears in all copies. This
|
||||
* software is provided "as is" without express or implied warranty, and
|
||||
* with no claim as to its suitability for any purpose.
|
||||
*
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
#include <boost/preprocessor/dec.hpp>
|
||||
#include <boost/preprocessor/list/adt.hpp>
|
||||
#include <boost/preprocessor/while.hpp>
|
||||
|
||||
/** <p>Expands to a list of the first <code>COUNT</code> elements of the list
|
||||
<code>LIST</code>.</p>
|
||||
|
||||
<p>For example,</p>
|
||||
|
||||
<pre>
|
||||
BOOST_PP_LIST_FIRST_N(2,BOOST_PP_TUPLE_TO_LIST(4,(+,-,*,/)))
|
||||
</pre>
|
||||
|
||||
<p>expands to the same as:</p>
|
||||
|
||||
<pre>
|
||||
BOOST_PP_TUPLE_TO_LIST(2,(+,-))
|
||||
</pre>
|
||||
|
||||
<h3>See</h3>
|
||||
<ul>
|
||||
<li>BOOST_PP_LIST_REST_N()</li>
|
||||
</ul>
|
||||
|
||||
<h3>Test</h3>
|
||||
<ul>
|
||||
<li><a href="../../test/list_test.cpp">list_test.cpp</a></li>
|
||||
</ul>
|
||||
*/
|
||||
#define BOOST_PP_LIST_FIRST_N(COUNT,LIST) BOOST_PP_LIST_FIRST_N_D(0,COUNT,LIST)
|
||||
|
||||
/** <p>Can be used inside BOOST_PP_WHILE() (see for an explanation the D parameter).</p> */
|
||||
#define BOOST_PP_LIST_FIRST_N_D(D,COUNT,LIST) BOOST_PP_LIST_REVERSE_D(D,BOOST_PP_TUPLE_ELEM(3,0,BOOST_PP_WHILE##D(BOOST_PP_LIST_FIRST_N_C,BOOST_PP_LIST_FIRST_N_F,((_,_,0),LIST,COUNT))))
|
||||
|
||||
#define BOOST_PP_LIST_FIRST_N_C(D,RLC) BOOST_PP_TUPLE_ELEM(3,2,RLC)
|
||||
#define BOOST_PP_LIST_FIRST_N_F(D,RLC) ((BOOST_PP_TUPLE_ELEM(3,0,BOOST_PP_TUPLE_ELEM(3,1,RLC)),BOOST_PP_TUPLE_ELEM(3,0,RLC),1),BOOST_PP_TUPLE_ELEM(3,1,BOOST_PP_TUPLE_ELEM(3,1,RLC)),BOOST_PP_DEC(BOOST_PP_TUPLE_ELEM(3,2,RLC)))
|
||||
|
||||
#endif
|
@ -1,104 +0,0 @@
|
||||
#ifndef BOOST_PREPROCESSOR_LIST_FOLD_LEFT_HPP
|
||||
#define BOOST_PREPROCESSOR_LIST_FOLD_LEFT_HPP
|
||||
|
||||
/* Copyright (C) 2001
|
||||
* Housemarque Oy
|
||||
* http://www.housemarque.com
|
||||
*
|
||||
* Permission to copy, use, modify, sell and distribute this software is
|
||||
* granted provided this copyright notice appears in all copies. This
|
||||
* software is provided "as is" without express or implied warranty, and
|
||||
* with no claim as to its suitability for any purpose.
|
||||
*
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
#include <boost/preprocessor/detail/auto_rec.hpp>
|
||||
#include <boost/preprocessor/expand.hpp>
|
||||
#include <boost/preprocessor/list/adt.hpp>
|
||||
#include <boost/preprocessor/while.hpp>
|
||||
|
||||
/** <p>Iterates <code>OP(D,STATE,X)</code> for each element <code>X</code> of the
|
||||
list <code>LIST</code> (from the left or the start of the list).</p>
|
||||
|
||||
<p>In other words, expands to:</p>
|
||||
|
||||
<pre>
|
||||
OP
|
||||
( D
|
||||
, ... OP(D, OP(D,STATE,BOOST_PP_LIST_AT(LIST,0)), BOOST_PP_LIST_AT(LIST,1)) ...
|
||||
, BOOST_PP_LIST_AT(LIST,BOOST_PP_DEC(BOOST_PP_LIST_SIZE(LIST))
|
||||
)
|
||||
</pre>
|
||||
|
||||
<p>For example,</p>
|
||||
|
||||
<pre>
|
||||
#define TEST(D,STATE,X) BOOST_PP_CAT(STATE,X)
|
||||
BOOST_PP_LIST_FOLD_LEFT(TEST,_,BOOST_PP_TUPLE_TO_LIST(3,(A,B,C)))
|
||||
</pre>
|
||||
|
||||
<p>expands to:</p>
|
||||
|
||||
<pre>
|
||||
_ABC
|
||||
</pre>
|
||||
|
||||
<h3>Note</h3>
|
||||
<ul>
|
||||
<li>Folding, or accumulation, is a very general pattern of computation.
|
||||
Most list operations can be implemented in terms of folding.</li>
|
||||
</ul>
|
||||
|
||||
<h3>See</h3>
|
||||
<ul>
|
||||
<li>BOOST_PP_LIST_FOLD_RIGHT()</li>
|
||||
</ul>
|
||||
|
||||
<h3>Test</h3>
|
||||
<ul>
|
||||
<li><a href="../../test/list_test.cpp">list_test.cpp</a></li>
|
||||
</ul>
|
||||
*/
|
||||
#define BOOST_PP_LIST_FOLD_LEFT(OP,STATE,LIST) BOOST_PP_LIST_FOLD_LEFT_D(0,OP,STATE,LIST)
|
||||
|
||||
/** <p>Can be used inside BOOST_PP_WHILE() (see for an explanation of the D parameter).</p>
|
||||
|
||||
<h3>Note</h3>
|
||||
<ul>
|
||||
<li>BOOST_PP_LIST_FOLD_LEFT_D() implements automatic recursion. You
|
||||
can use a fold in the OP macro.</li>
|
||||
</ul>
|
||||
*/
|
||||
#if 0
|
||||
# define BOOST_PP_LIST_FOLD_LEFT_D(D,OP,STATE,LIST)
|
||||
#endif
|
||||
|
||||
#define BOOST_PP_LIST_FOLD_LEFT_D\
|
||||
BOOST_PP_AUTO_REC_CAT1(BOOST_PP_LIST_FOLD_LEFT_D,BOOST_PP_LIST_FOLD_LEFT_D_AUTO_REC1(BOOST_PP_AUTO_REC_ID,(1)))
|
||||
#define BOOST_PP_LIST_FOLD_LEFT_DBOOST_PP_LIST_FOLD_LEFT_D_AUTO_REC1(M,P)\
|
||||
BOOST_PP_AUTO_REC_CAT2(BOOST_PP_LIST_FOLD_LEFT_D,BOOST_PP_LIST_FOLD_LEFT_D_AUTO_REC2(BOOST_PP_AUTO_REC_ID,(2)))
|
||||
#define BOOST_PP_LIST_FOLD_LEFT_DBOOST_PP_LIST_FOLD_LEFT_D_AUTO_REC2(M,P)\
|
||||
BOOST_PP_AUTO_REC_CAT3(BOOST_PP_LIST_FOLD_LEFT_D,BOOST_PP_LIST_FOLD_LEFT_D_AUTO_REC3(BOOST_PP_AUTO_REC_ID,(3)))
|
||||
#define BOOST_PP_LIST_FOLD_LEFT_DBOOST_PP_LIST_FOLD_LEFT_D_AUTO_REC3(M,P)\
|
||||
(TOO MANY NESTED FOLDS!)
|
||||
|
||||
#define BOOST_PP_LIST_FOLD_LEFT_D1(D,O,S,L) BOOST_PP_TUPLE_ELEM(3,1,BOOST_PP_LIST_FOLD_LEFT_D_AUTO_REC1(BOOST_PP_WHILE##D,(BOOST_PP_LIST_FOLD_LEFT_P,BOOST_PP_LIST_FOLD_LEFT_O1,(O,S,L))))
|
||||
#define BOOST_PP_LIST_FOLD_LEFT_D2(D,O,S,L) BOOST_PP_TUPLE_ELEM(3,1,BOOST_PP_LIST_FOLD_LEFT_D_AUTO_REC2(BOOST_PP_WHILE##D,(BOOST_PP_LIST_FOLD_LEFT_P,BOOST_PP_LIST_FOLD_LEFT_O2,(O,S,L))))
|
||||
#define BOOST_PP_LIST_FOLD_LEFT_D3(D,O,S,L) BOOST_PP_TUPLE_ELEM(3,1,BOOST_PP_LIST_FOLD_LEFT_D_AUTO_REC3(BOOST_PP_WHILE##D,(BOOST_PP_LIST_FOLD_LEFT_P,BOOST_PP_LIST_FOLD_LEFT_O3,(O,S,L))))
|
||||
|
||||
#define BOOST_PP_LIST_FOLD_LEFT_D_AUTO_REC1(M,P) BOOST_PP_EXPAND(M P)
|
||||
#define BOOST_PP_LIST_FOLD_LEFT_D_AUTO_REC2(M,P) BOOST_PP_EXPAND(M P)
|
||||
#define BOOST_PP_LIST_FOLD_LEFT_D_AUTO_REC3(M,P) BOOST_PP_EXPAND(M P)
|
||||
|
||||
#define BOOST_PP_LIST_FOLD_LEFT_P(D,OSL) BOOST_PP_TUPLE_ELEM(3,2,BOOST_PP_TUPLE_ELEM(3,2,OSL))
|
||||
|
||||
#define BOOST_PP_LIST_FOLD_LEFT_O1(D,OSL) (BOOST_PP_TUPLE_ELEM(3,0,OSL),BOOST_PP_TUPLE_ELEM(3,0,OSL)(D,BOOST_PP_TUPLE_ELEM(3,1,OSL),BOOST_PP_TUPLE_ELEM(3,0,BOOST_PP_TUPLE_ELEM(3,2,OSL))),BOOST_PP_TUPLE_ELEM(3,1,BOOST_PP_TUPLE_ELEM(3,2,OSL)))
|
||||
#define BOOST_PP_LIST_FOLD_LEFT_O2(D,OSL) (BOOST_PP_TUPLE_ELEM(3,0,OSL),BOOST_PP_TUPLE_ELEM(3,0,OSL)(D,BOOST_PP_TUPLE_ELEM(3,1,OSL),BOOST_PP_TUPLE_ELEM(3,0,BOOST_PP_TUPLE_ELEM(3,2,OSL))),BOOST_PP_TUPLE_ELEM(3,1,BOOST_PP_TUPLE_ELEM(3,2,OSL)))
|
||||
#define BOOST_PP_LIST_FOLD_LEFT_O3(D,OSL) (BOOST_PP_TUPLE_ELEM(3,0,OSL),BOOST_PP_TUPLE_ELEM(3,0,OSL)(D,BOOST_PP_TUPLE_ELEM(3,1,OSL),BOOST_PP_TUPLE_ELEM(3,0,BOOST_PP_TUPLE_ELEM(3,2,OSL))),BOOST_PP_TUPLE_ELEM(3,1,BOOST_PP_TUPLE_ELEM(3,2,OSL)))
|
||||
|
||||
/** <p>Obsolete, just use BOOST_PP_LIST_FOLD_LEFT().</p> */
|
||||
#define BOOST_PP_LIST_FOLD_LEFT_2ND BOOST_PP_LIST_FOLD_LEFT
|
||||
/** <p>Obsolete, just use BOOST_PP_LIST_FOLD_LEFT_D().</p> */
|
||||
#define BOOST_PP_LIST_FOLD_LEFT_2ND_D BOOST_PP_LIST_FOLD_LEFT_D
|
||||
#endif
|
@ -1,24 +0,0 @@
|
||||
#ifndef BOOST_PREPROCESSOR_LIST_FOLD_LEFT_2ND_HPP
|
||||
#define BOOST_PREPROCESSOR_LIST_FOLD_LEFT_2ND_HPP
|
||||
|
||||
/* Copyright (C) 2002
|
||||
* Housemarque Oy
|
||||
* http://www.housemarque.com
|
||||
*
|
||||
* Permission to copy, use, modify, sell and distribute this software is
|
||||
* granted provided this copyright notice appears in all copies. This
|
||||
* software is provided "as is" without express or implied warranty, and
|
||||
* with no claim as to its suitability for any purpose.
|
||||
*
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
/** <p>This header is obsolete. Use the following code instead.</p>
|
||||
|
||||
<pre>
|
||||
#include <boost/preprocessor/list/fold_left.hpp>
|
||||
</pre>
|
||||
*/
|
||||
|
||||
#include <boost/preprocessor/list/fold_left.hpp>
|
||||
#endif
|
@ -1,98 +0,0 @@
|
||||
#ifndef BOOST_PREPROCESSOR_LIST_FOLD_RIGHT_HPP
|
||||
#define BOOST_PREPROCESSOR_LIST_FOLD_RIGHT_HPP
|
||||
|
||||
/* Copyright (C) 2001
|
||||
* Housemarque Oy
|
||||
* http://www.housemarque.com
|
||||
*
|
||||
* Permission to copy, use, modify, sell and distribute this software is
|
||||
* granted provided this copyright notice appears in all copies. This
|
||||
* software is provided "as is" without express or implied warranty, and
|
||||
* with no claim as to its suitability for any purpose.
|
||||
*
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
#include <boost/preprocessor/list/reverse.hpp>
|
||||
|
||||
/** <p>Iterates <code>OP(D,X,STATE)</code> for each element <code>X</code> of the
|
||||
list <code>LIST</code> (from the right or the end of the list).</p>
|
||||
|
||||
<p>In other words, expands to:</p>
|
||||
|
||||
<pre>
|
||||
OP
|
||||
( D
|
||||
, BOOST_PP_LIST_AT(LIST,0)
|
||||
, ... OP
|
||||
( D
|
||||
, BOOST_PP_LIST_AT(LIST,BOOST_PP_SUB(BOOST_PP_LIST_SIZE(LIST),2))
|
||||
, OP
|
||||
( D
|
||||
, BOOST_PP_LIST_AT(LIST,BOOST_PP_SUB(BOOST_PP_LIST_SIZE(LIST),1))
|
||||
, STATE
|
||||
)
|
||||
) ...
|
||||
)
|
||||
</pre>
|
||||
|
||||
<p>For example,</p>
|
||||
|
||||
<pre>
|
||||
#define TEST(D,X,STATE) BOOST_PP_CAT(STATE,X)
|
||||
BOOST_PP_LIST_FOLD_RIGHT(TEST,_,BOOST_PP_TUPLE_TO_LIST(3,(A,B,C)))
|
||||
</pre>
|
||||
|
||||
<p>expands to:</p>
|
||||
|
||||
<pre>
|
||||
_CBA
|
||||
</pre>
|
||||
|
||||
<h3>Note</h3>
|
||||
<ul>
|
||||
<li>Folding, or accumulation, is a very general pattern of computation.
|
||||
Most list operations can be implemented in terms of folding.</li>
|
||||
</ul>
|
||||
|
||||
<h3>Test</h3>
|
||||
<ul>
|
||||
<li><a href="../../test/list_test.cpp">list_test.cpp</a></li>
|
||||
</ul>
|
||||
*/
|
||||
#define BOOST_PP_LIST_FOLD_RIGHT(OP,LIST,STATE) BOOST_PP_LIST_FOLD_RIGHT_D(0,OP,LIST,STATE)
|
||||
|
||||
/** <p>Can be used inside BOOST_PP_WHILE() (see for an explanation of the D parameter).</p>
|
||||
|
||||
<h3>Note</h3>
|
||||
<ul>
|
||||
<li>BOOST_PP_LIST_FOLD_RIGHT_D() implements automatic recursion. You
|
||||
can use a fold in the OP macro.</li>
|
||||
</ul>
|
||||
*/
|
||||
#if 0
|
||||
# define BOOST_PP_LIST_FOLD_RIGHT_D(D,OP,LIST,STATE)
|
||||
#endif
|
||||
|
||||
#define BOOST_PP_LIST_FOLD_RIGHT_D\
|
||||
BOOST_PP_AUTO_REC_CAT1(BOOST_PP_LIST_FOLD_RIGHT_D,BOOST_PP_LIST_FOLD_LEFT_D_AUTO_REC1(BOOST_PP_AUTO_REC_ID,(1)))
|
||||
#define BOOST_PP_LIST_FOLD_RIGHT_DBOOST_PP_LIST_FOLD_LEFT_D_AUTO_REC1(M,P)\
|
||||
BOOST_PP_AUTO_REC_CAT2(BOOST_PP_LIST_FOLD_RIGHT_D,BOOST_PP_LIST_FOLD_LEFT_D_AUTO_REC2(BOOST_PP_AUTO_REC_ID,(2)))
|
||||
#define BOOST_PP_LIST_FOLD_RIGHT_DBOOST_PP_LIST_FOLD_LEFT_D_AUTO_REC2(M,P)\
|
||||
BOOST_PP_AUTO_REC_CAT3(BOOST_PP_LIST_FOLD_RIGHT_D,BOOST_PP_LIST_FOLD_LEFT_D_AUTO_REC3(BOOST_PP_AUTO_REC_ID,(3)))
|
||||
#define BOOST_PP_LIST_FOLD_RIGHT_DBOOST_PP_LIST_FOLD_LEFT_D_AUTO_REC3(M,P)\
|
||||
(TOO MANY NESTED FOLDS!)
|
||||
|
||||
#define BOOST_PP_LIST_FOLD_RIGHT_D1(D,O,L,S) BOOST_PP_TUPLE_ELEM(2,1,BOOST_PP_LIST_FOLD_LEFT_D(D,BOOST_PP_LIST_FOLD_RIGHT_O1,(O,S),BOOST_PP_LIST_REVERSE_D(D,L)))
|
||||
#define BOOST_PP_LIST_FOLD_RIGHT_D2(D,O,L,S) BOOST_PP_TUPLE_ELEM(2,1,BOOST_PP_LIST_FOLD_LEFT_D(D,BOOST_PP_LIST_FOLD_RIGHT_O2,(O,S),BOOST_PP_LIST_REVERSE_D(D,L)))
|
||||
#define BOOST_PP_LIST_FOLD_RIGHT_D3(D,O,L,S) BOOST_PP_TUPLE_ELEM(2,1,BOOST_PP_LIST_FOLD_LEFT_D(D,BOOST_PP_LIST_FOLD_RIGHT_O3,(O,S),BOOST_PP_LIST_REVERSE_D(D,L)))
|
||||
|
||||
#define BOOST_PP_LIST_FOLD_RIGHT_O1(D,OS,X) (BOOST_PP_TUPLE_ELEM(2,0,OS),BOOST_PP_TUPLE_ELEM(2,0,OS)(D,X,BOOST_PP_TUPLE_ELEM(2,1,OS)))
|
||||
#define BOOST_PP_LIST_FOLD_RIGHT_O2(D,OS,X) (BOOST_PP_TUPLE_ELEM(2,0,OS),BOOST_PP_TUPLE_ELEM(2,0,OS)(D,X,BOOST_PP_TUPLE_ELEM(2,1,OS)))
|
||||
#define BOOST_PP_LIST_FOLD_RIGHT_O3(D,OS,X) (BOOST_PP_TUPLE_ELEM(2,0,OS),BOOST_PP_TUPLE_ELEM(2,0,OS)(D,X,BOOST_PP_TUPLE_ELEM(2,1,OS)))
|
||||
|
||||
/** <p>Obsolete, just use BOOST_PP_LIST_FOLD_RIGHT().</p> */
|
||||
#define BOOST_PP_LIST_FOLD_RIGHT_2ND BOOST_PP_LIST_FOLD_RIGHT
|
||||
/** <p>Obsolete, just use BOOST_PP_LIST_FOLD_RIGHT_D().</p> */
|
||||
#define BOOST_PP_LIST_FOLD_RIGHT_2ND_D BOOST_PP_LIST_FOLD_RIGHT_D
|
||||
#endif
|
@ -1,24 +0,0 @@
|
||||
#ifndef BOOST_PREPROCESSOR_LIST_FOLD_RIGHT_2ND_HPP
|
||||
#define BOOST_PREPROCESSOR_LIST_FOLD_RIGHT_2ND_HPP
|
||||
|
||||
/* Copyright (C) 2002
|
||||
* Housemarque Oy
|
||||
* http://www.housemarque.com
|
||||
*
|
||||
* Permission to copy, use, modify, sell and distribute this software is
|
||||
* granted provided this copyright notice appears in all copies. This
|
||||
* software is provided "as is" without express or implied warranty, and
|
||||
* with no claim as to its suitability for any purpose.
|
||||
*
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
/** <p>This header is obsolete. Use the following code instead.</p>
|
||||
|
||||
<pre>
|
||||
#include <boost/preprocessor/list/fold_right.hpp>
|
||||
</pre>
|
||||
*/
|
||||
|
||||
#include <boost/preprocessor/list/fold_right.hpp>
|
||||
#endif
|
@ -1,58 +0,0 @@
|
||||
#ifndef BOOST_PREPROCESSOR_LIST_FOR_EACH_HPP
|
||||
#define BOOST_PREPROCESSOR_LIST_FOR_EACH_HPP
|
||||
|
||||
/* Copyright (C) 2001
|
||||
* Housemarque Oy
|
||||
* http://www.housemarque.com
|
||||
*
|
||||
* Permission to copy, use, modify, sell and distribute this software is
|
||||
* granted provided this copyright notice appears in all copies. This
|
||||
* software is provided "as is" without express or implied warranty, and
|
||||
* with no claim as to its suitability for any purpose.
|
||||
*
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
#include <boost/preprocessor/list/for_each_i.hpp>
|
||||
|
||||
/** <p>Repeats <code>MACRO(R,DATA,BOOST_PP_LIST_AT(LIST,INDEX))</code> for each INDEX = [0,
|
||||
BOOST_PP_LIST_SIZE(LIST)).</p>
|
||||
|
||||
<p>In other words, expands to the sequence:</p>
|
||||
|
||||
<pre>
|
||||
MACRO(R,DATA,BOOST_PP_LIST_AT(LIST,0))
|
||||
MACRO(R,DATA,BOOST_PP_LIST_AT(LIST,1))
|
||||
...
|
||||
MACRO(R,DATA,BOOST_PP_LIST_AT(LIST,BOOST_PP_DEC(BOOST_PP_LIST_SIZE(LIST))))
|
||||
</pre>
|
||||
|
||||
<p>For example,</p>
|
||||
|
||||
<pre>
|
||||
#define TEST(R,DATA,X) BOOST_PP_CAT(DATA,X)();
|
||||
BOOST_PP_LIST_FOR_EACH(TEST,prefix_,BOOST_PP_TUPLE_TO_LIST(3,(A,B,C)))
|
||||
</pre>
|
||||
|
||||
<p>expands to:</p>
|
||||
|
||||
<pre>
|
||||
prefix_A(); prefix_B(); prefix_C();
|
||||
</pre>
|
||||
|
||||
<h3>Example</h3>
|
||||
<ul>
|
||||
<li><a href="../../example/catch_builtin.cpp">catch_builtin.cpp</a></li>
|
||||
</ul>
|
||||
|
||||
<h3>Test</h3>
|
||||
<ul>
|
||||
<li><a href="../../test/list_test.cpp">list_test.cpp</a></li>
|
||||
</ul>
|
||||
*/
|
||||
#define BOOST_PP_LIST_FOR_EACH(MACRO,DATA,LIST) BOOST_PP_LIST_FOR_EACH_R(0,MACRO,DATA,LIST)
|
||||
|
||||
/** <p>Can be used inside BOOST_PP_FOR() (see for an explanation of the R parameter).</p> */
|
||||
#define BOOST_PP_LIST_FOR_EACH_R(R,MACRO,DATA,LIST) BOOST_PP_LIST_FOR_EACH_I_R(R,BOOST_PP_LIST_FOR_EACH_F,(MACRO,DATA),LIST)
|
||||
#define BOOST_PP_LIST_FOR_EACH_F(R,MD,I,X) BOOST_PP_TUPLE_ELEM(2,0,MD)(R,BOOST_PP_TUPLE_ELEM(2,1,MD),X)
|
||||
#endif
|
@ -1,52 +0,0 @@
|
||||
#ifndef BOOST_PREPROCESSOR_LIST_FOR_EACH_I_HPP
|
||||
#define BOOST_PREPROCESSOR_LIST_FOR_EACH_I_HPP
|
||||
|
||||
/* Copyright (C) 2002
|
||||
* Housemarque Oy
|
||||
* http://www.housemarque.com
|
||||
*
|
||||
* Permission to copy, use, modify, sell and distribute this software is
|
||||
* granted provided this copyright notice appears in all copies. This
|
||||
* software is provided "as is" without express or implied warranty, and
|
||||
* with no claim as to its suitability for any purpose.
|
||||
*
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
#include <boost/preprocessor/list/adt.hpp>
|
||||
#include <boost/preprocessor/inc.hpp>
|
||||
#include <boost/preprocessor/for.hpp>
|
||||
|
||||
/** <p>Repeats <code>MACRO(R,DATA,INDEX,BOOST_PP_LIST_AT(LIST,INDEX))</code> for each INDEX = [0,
|
||||
BOOST_PP_LIST_SIZE(LIST)).</p>
|
||||
|
||||
<p>In other words, expands to the sequence:</p>
|
||||
|
||||
<pre>
|
||||
MACRO(R,DATA,0,BOOST_PP_LIST_AT(LIST,0))
|
||||
MACRO(R,DATA,1,BOOST_PP_LIST_AT(LIST,1))
|
||||
...
|
||||
MACRO(R,DATA,BOOST_PP_DEC(BOOST_PP_LIST_SIZE(LIST)),BOOST_PP_LIST_AT(LIST,BOOST_PP_DEC(BOOST_PP_LIST_SIZE(LIST))))
|
||||
</pre>
|
||||
|
||||
<p>For example,</p>
|
||||
|
||||
<pre>
|
||||
#define TEST(R,DATA,INDEX,X) BOOST_PP_CAT(DATA,X)(INDEX);
|
||||
BOOST_PP_LIST_FOR_EACH_I(TEST,prefix_,BOOST_PP_TUPLE_TO_LIST(3,(A,B,C)))
|
||||
</pre>
|
||||
|
||||
<p>expands to:</p>
|
||||
|
||||
<pre>
|
||||
prefix_A(0); prefix_B(1); prefix_C(2);
|
||||
</pre>
|
||||
*/
|
||||
#define BOOST_PP_LIST_FOR_EACH_I(MACRO,DATA,LIST) BOOST_PP_LIST_FOR_EACH_I_R(0,MACRO,DATA,LIST)
|
||||
|
||||
/** <p>Can be used inside BOOST_PP_FOR() (see for an explanation of the R parameter).</p> */
|
||||
#define BOOST_PP_LIST_FOR_EACH_I_R(R,MACRO,DATA,LIST) BOOST_PP_FOR##R((MACRO,DATA,LIST,0),BOOST_PP_LIST_FOR_EACH_I_P,BOOST_PP_LIST_FOR_EACH_I_O,BOOST_PP_LIST_FOR_EACH_I_M)
|
||||
#define BOOST_PP_LIST_FOR_EACH_I_P(R,MDLI) BOOST_PP_TUPLE_ELEM(3,2,BOOST_PP_TUPLE_ELEM(4,2,MDLI))
|
||||
#define BOOST_PP_LIST_FOR_EACH_I_O(R,MDLI) (BOOST_PP_TUPLE_ELEM(4,0,MDLI),BOOST_PP_TUPLE_ELEM(4,1,MDLI),BOOST_PP_TUPLE_ELEM(3,1,BOOST_PP_TUPLE_ELEM(4,2,MDLI)),BOOST_PP_INC(BOOST_PP_TUPLE_ELEM(4,3,MDLI)))
|
||||
#define BOOST_PP_LIST_FOR_EACH_I_M(R,MDLI) BOOST_PP_TUPLE_ELEM(4,0,MDLI)(R,BOOST_PP_TUPLE_ELEM(4,1,MDLI),BOOST_PP_TUPLE_ELEM(4,3,MDLI),BOOST_PP_TUPLE_ELEM(3,0,BOOST_PP_TUPLE_ELEM(4,2,MDLI)))
|
||||
#endif
|
@ -1,135 +0,0 @@
|
||||
#ifndef BOOST_PREPROCESSOR_LIST_FOR_EACH_PRODUCT_HPP
|
||||
#define BOOST_PREPROCESSOR_LIST_FOR_EACH_PRODUCT_HPP
|
||||
|
||||
/* Copyright (C) 2002
|
||||
* Housemarque Oy
|
||||
* http://www.housemarque.com
|
||||
*
|
||||
* Permission to copy, use, modify, sell and distribute this software is
|
||||
* granted provided this copyright notice appears in all copies. This
|
||||
* software is provided "as is" without express or implied warranty, and
|
||||
* with no claim as to its suitability for any purpose.
|
||||
*
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
#include <boost/preprocessor/list/adt.hpp>
|
||||
#include <boost/preprocessor/list/to_tuple.hpp>
|
||||
#include <boost/preprocessor/tuple/to_list.hpp>
|
||||
#include <boost/preprocessor/tuple/reverse.hpp>
|
||||
#include <boost/preprocessor/for.hpp>
|
||||
|
||||
/** <p>Repeats <code>MACRO(R,X)</code> for each element <code>X</code> of the
|
||||
cartesian product of the lists of the <code>SIZE_OF_TUPLE</code>-tuple <code>TUPLE_OF_LISTS</code>.</p>
|
||||
|
||||
<p>This macro is useful for generating code to avoid combinatorial
|
||||
explosion.</p>
|
||||
|
||||
<p>For example,</p>
|
||||
|
||||
<pre>
|
||||
#define TEST(R,X) X
|
||||
BOOST_PP_LIST_FOR_EACH_PRODUCT
|
||||
( TEST
|
||||
, 2
|
||||
, ( BOOST_PP_TUPLE_TO_LIST(3,(A,B,C))
|
||||
, BOOST_PP_TUPLE_TO_LIST(2,(1,2))
|
||||
)
|
||||
)
|
||||
</pre>
|
||||
|
||||
<p>expands to:</p>
|
||||
|
||||
<pre>
|
||||
(A,1) (A,2) (B,1) (B,2) (C,1) (C,2)
|
||||
</pre>
|
||||
|
||||
<h3>Example</h3>
|
||||
<ul>
|
||||
<li><a href="../../example/is_integral.cpp">is_integral.cpp</a></li>
|
||||
<li><a href="../../example/array_arithmetic.c">array_arithmetic.c</a></li>
|
||||
</ul>
|
||||
|
||||
<h3>Test</h3>
|
||||
<ul>
|
||||
<li><a href="../../test/list_test.cpp">list_test.cpp</a></li>
|
||||
</ul>
|
||||
*/
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT(MACRO,SIZE_OF_TUPLE,TUPLE_OF_LISTS) BOOST_PP_LIST_FOR_EACH_PRODUCT_R(0,MACRO,SIZE_OF_TUPLE,TUPLE_OF_LISTS)
|
||||
|
||||
/** <p>Can be used inside BOOST_PP_FOR() (see for an explanation of the R parameter).</p> */
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_R(R,MACRO,SIZE_OF_TUPLE,TUPLE_OF_LISTS) BOOST_PP_LIST_FOR_EACH_PRODUCT_R2(0,MACRO,BOOST_PP_TUPLE_TO_LIST(SIZE_OF_TUPLE,BOOST_PP_TUPLE_REVERSE(SIZE_OF_TUPLE,TUPLE_OF_LISTS)))
|
||||
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_R2(R,F,LL) BOOST_PP_FOR##R((BOOST_PP_TUPLE_ELEM(3,0,LL),BOOST_PP_TUPLE_ELEM(3,1,LL),(_,_,0),F),BOOST_PP_LIST_FOR_EACH_PRODUCT_C,BOOST_PP_LIST_FOR_EACH_PRODUCT_F,BOOST_PP_LIST_FOR_EACH_PRODUCT_I0)
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_C(R,P) BOOST_PP_TUPLE_ELEM(3,2,BOOST_PP_TUPLE_ELEM(4,0,P))
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_F(R,P) (BOOST_PP_LIST_REST(BOOST_PP_TUPLE_ELEM(4,0,P)),BOOST_PP_TUPLE_ELEM(4,1,P),BOOST_PP_TUPLE_ELEM(4,2,P),BOOST_PP_TUPLE_ELEM(4,3,P))
|
||||
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I(R,P) BOOST_PP_TUPLE_ELEM(4,3,P)(R,BOOST_PP_LIST_TO_TUPLE_R(R,(BOOST_PP_TUPLE_ELEM(3,0,BOOST_PP_TUPLE_ELEM(4,0,P)),BOOST_PP_TUPLE_ELEM(4,2,P),1)))
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I_C(P,I) BOOST_PP_IF(BOOST_PP_TUPLE_ELEM(3,2,BOOST_PP_TUPLE_ELEM(4,1,P)),BOOST_PP_LIST_FOR_EACH_PRODUCT_I##I##_C,BOOST_PP_LIST_FOR_EACH_PRODUCT_I)
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I_H(P) (BOOST_PP_TUPLE_ELEM(3,0,BOOST_PP_TUPLE_ELEM(4,1,P)),BOOST_PP_TUPLE_ELEM(3,1,BOOST_PP_TUPLE_ELEM(4,1,P)),(BOOST_PP_TUPLE_ELEM(3,0,BOOST_PP_TUPLE_ELEM(4,0,P)),BOOST_PP_TUPLE_ELEM(4,2,P),1),BOOST_PP_TUPLE_ELEM(4,3,P))
|
||||
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I0_C(R,P) BOOST_PP_FOR##R(BOOST_PP_LIST_FOR_EACH_PRODUCT_I_H(P),BOOST_PP_LIST_FOR_EACH_PRODUCT_C,BOOST_PP_LIST_FOR_EACH_PRODUCT_F,BOOST_PP_LIST_FOR_EACH_PRODUCT_I1)
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I0(R,P) BOOST_PP_LIST_FOR_EACH_PRODUCT_I_C(P,0)(R,P)
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I1_C(R,P) BOOST_PP_FOR##R(BOOST_PP_LIST_FOR_EACH_PRODUCT_I_H(P),BOOST_PP_LIST_FOR_EACH_PRODUCT_C,BOOST_PP_LIST_FOR_EACH_PRODUCT_F,BOOST_PP_LIST_FOR_EACH_PRODUCT_I2)
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I1(R,P) BOOST_PP_LIST_FOR_EACH_PRODUCT_I_C(P,1)(R,P)
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I2_C(R,P) BOOST_PP_FOR##R(BOOST_PP_LIST_FOR_EACH_PRODUCT_I_H(P),BOOST_PP_LIST_FOR_EACH_PRODUCT_C,BOOST_PP_LIST_FOR_EACH_PRODUCT_F,BOOST_PP_LIST_FOR_EACH_PRODUCT_I3)
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I2(R,P) BOOST_PP_LIST_FOR_EACH_PRODUCT_I_C(P,2)(R,P)
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I3_C(R,P) BOOST_PP_FOR##R(BOOST_PP_LIST_FOR_EACH_PRODUCT_I_H(P),BOOST_PP_LIST_FOR_EACH_PRODUCT_C,BOOST_PP_LIST_FOR_EACH_PRODUCT_F,BOOST_PP_LIST_FOR_EACH_PRODUCT_I4)
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I3(R,P) BOOST_PP_LIST_FOR_EACH_PRODUCT_I_C(P,3)(R,P)
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I4_C(R,P) BOOST_PP_FOR##R(BOOST_PP_LIST_FOR_EACH_PRODUCT_I_H(P),BOOST_PP_LIST_FOR_EACH_PRODUCT_C,BOOST_PP_LIST_FOR_EACH_PRODUCT_F,BOOST_PP_LIST_FOR_EACH_PRODUCT_I5)
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I4(R,P) BOOST_PP_LIST_FOR_EACH_PRODUCT_I_C(P,4)(R,P)
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I5_C(R,P) BOOST_PP_FOR##R(BOOST_PP_LIST_FOR_EACH_PRODUCT_I_H(P),BOOST_PP_LIST_FOR_EACH_PRODUCT_C,BOOST_PP_LIST_FOR_EACH_PRODUCT_F,BOOST_PP_LIST_FOR_EACH_PRODUCT_I6)
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I5(R,P) BOOST_PP_LIST_FOR_EACH_PRODUCT_I_C(P,5)(R,P)
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I6_C(R,P) BOOST_PP_FOR##R(BOOST_PP_LIST_FOR_EACH_PRODUCT_I_H(P),BOOST_PP_LIST_FOR_EACH_PRODUCT_C,BOOST_PP_LIST_FOR_EACH_PRODUCT_F,BOOST_PP_LIST_FOR_EACH_PRODUCT_I7)
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I6(R,P) BOOST_PP_LIST_FOR_EACH_PRODUCT_I_C(P,6)(R,P)
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I7_C(R,P) BOOST_PP_FOR##R(BOOST_PP_LIST_FOR_EACH_PRODUCT_I_H(P),BOOST_PP_LIST_FOR_EACH_PRODUCT_C,BOOST_PP_LIST_FOR_EACH_PRODUCT_F,BOOST_PP_LIST_FOR_EACH_PRODUCT_I8)
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I7(R,P) BOOST_PP_LIST_FOR_EACH_PRODUCT_I_C(P,7)(R,P)
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I8_C(R,P) BOOST_PP_FOR##R(BOOST_PP_LIST_FOR_EACH_PRODUCT_I_H(P),BOOST_PP_LIST_FOR_EACH_PRODUCT_C,BOOST_PP_LIST_FOR_EACH_PRODUCT_F,BOOST_PP_LIST_FOR_EACH_PRODUCT_I9)
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I8(R,P) BOOST_PP_LIST_FOR_EACH_PRODUCT_I_C(P,8)(R,P)
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I9_C(R,P) BOOST_PP_FOR##R(BOOST_PP_LIST_FOR_EACH_PRODUCT_I_H(P),BOOST_PP_LIST_FOR_EACH_PRODUCT_C,BOOST_PP_LIST_FOR_EACH_PRODUCT_F,BOOST_PP_LIST_FOR_EACH_PRODUCT_I10)
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I9(R,P) BOOST_PP_LIST_FOR_EACH_PRODUCT_I_C(P,9)(R,P)
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I10_C(R,P) BOOST_PP_FOR##R(BOOST_PP_LIST_FOR_EACH_PRODUCT_I_H(P),BOOST_PP_LIST_FOR_EACH_PRODUCT_C,BOOST_PP_LIST_FOR_EACH_PRODUCT_F,BOOST_PP_LIST_FOR_EACH_PRODUCT_I11)
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I10(R,P) BOOST_PP_LIST_FOR_EACH_PRODUCT_I_C(P,10)(R,P)
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I11_C(R,P) BOOST_PP_FOR##R(BOOST_PP_LIST_FOR_EACH_PRODUCT_I_H(P),BOOST_PP_LIST_FOR_EACH_PRODUCT_C,BOOST_PP_LIST_FOR_EACH_PRODUCT_F,BOOST_PP_LIST_FOR_EACH_PRODUCT_I12)
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I11(R,P) BOOST_PP_LIST_FOR_EACH_PRODUCT_I_C(P,11)(R,P)
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I12_C(R,P) BOOST_PP_FOR##R(BOOST_PP_LIST_FOR_EACH_PRODUCT_I_H(P),BOOST_PP_LIST_FOR_EACH_PRODUCT_C,BOOST_PP_LIST_FOR_EACH_PRODUCT_F,BOOST_PP_LIST_FOR_EACH_PRODUCT_I13)
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I12(R,P) BOOST_PP_LIST_FOR_EACH_PRODUCT_I_C(P,12)(R,P)
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I13_C(R,P) BOOST_PP_FOR##R(BOOST_PP_LIST_FOR_EACH_PRODUCT_I_H(P),BOOST_PP_LIST_FOR_EACH_PRODUCT_C,BOOST_PP_LIST_FOR_EACH_PRODUCT_F,BOOST_PP_LIST_FOR_EACH_PRODUCT_I14)
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I13(R,P) BOOST_PP_LIST_FOR_EACH_PRODUCT_I_C(P,13)(R,P)
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I14_C(R,P) BOOST_PP_FOR##R(BOOST_PP_LIST_FOR_EACH_PRODUCT_I_H(P),BOOST_PP_LIST_FOR_EACH_PRODUCT_C,BOOST_PP_LIST_FOR_EACH_PRODUCT_F,BOOST_PP_LIST_FOR_EACH_PRODUCT_I15)
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I14(R,P) BOOST_PP_LIST_FOR_EACH_PRODUCT_I_C(P,14)(R,P)
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I15_C(R,P) BOOST_PP_FOR##R(BOOST_PP_LIST_FOR_EACH_PRODUCT_I_H(P),BOOST_PP_LIST_FOR_EACH_PRODUCT_C,BOOST_PP_LIST_FOR_EACH_PRODUCT_F,BOOST_PP_LIST_FOR_EACH_PRODUCT_I16)
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I15(R,P) BOOST_PP_LIST_FOR_EACH_PRODUCT_I_C(P,15)(R,P)
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I16_C(R,P) BOOST_PP_FOR##R(BOOST_PP_LIST_FOR_EACH_PRODUCT_I_H(P),BOOST_PP_LIST_FOR_EACH_PRODUCT_C,BOOST_PP_LIST_FOR_EACH_PRODUCT_F,BOOST_PP_LIST_FOR_EACH_PRODUCT_I17)
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I16(R,P) BOOST_PP_LIST_FOR_EACH_PRODUCT_I_C(P,16)(R,P)
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I17_C(R,P) BOOST_PP_FOR##R(BOOST_PP_LIST_FOR_EACH_PRODUCT_I_H(P),BOOST_PP_LIST_FOR_EACH_PRODUCT_C,BOOST_PP_LIST_FOR_EACH_PRODUCT_F,BOOST_PP_LIST_FOR_EACH_PRODUCT_I18)
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I17(R,P) BOOST_PP_LIST_FOR_EACH_PRODUCT_I_C(P,17)(R,P)
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I18_C(R,P) BOOST_PP_FOR##R(BOOST_PP_LIST_FOR_EACH_PRODUCT_I_H(P),BOOST_PP_LIST_FOR_EACH_PRODUCT_C,BOOST_PP_LIST_FOR_EACH_PRODUCT_F,BOOST_PP_LIST_FOR_EACH_PRODUCT_I19)
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I18(R,P) BOOST_PP_LIST_FOR_EACH_PRODUCT_I_C(P,18)(R,P)
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I19_C(R,P) BOOST_PP_FOR##R(BOOST_PP_LIST_FOR_EACH_PRODUCT_I_H(P),BOOST_PP_LIST_FOR_EACH_PRODUCT_C,BOOST_PP_LIST_FOR_EACH_PRODUCT_F,BOOST_PP_LIST_FOR_EACH_PRODUCT_I20)
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I19(R,P) BOOST_PP_LIST_FOR_EACH_PRODUCT_I_C(P,19)(R,P)
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I20_C(R,P) BOOST_PP_FOR##R(BOOST_PP_LIST_FOR_EACH_PRODUCT_I_H(P),BOOST_PP_LIST_FOR_EACH_PRODUCT_C,BOOST_PP_LIST_FOR_EACH_PRODUCT_F,BOOST_PP_LIST_FOR_EACH_PRODUCT_I21)
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I20(R,P) BOOST_PP_LIST_FOR_EACH_PRODUCT_I_C(P,20)(R,P)
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I21_C(R,P) BOOST_PP_FOR##R(BOOST_PP_LIST_FOR_EACH_PRODUCT_I_H(P),BOOST_PP_LIST_FOR_EACH_PRODUCT_C,BOOST_PP_LIST_FOR_EACH_PRODUCT_F,BOOST_PP_LIST_FOR_EACH_PRODUCT_I22)
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I21(R,P) BOOST_PP_LIST_FOR_EACH_PRODUCT_I_C(P,21)(R,P)
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I22_C(R,P) BOOST_PP_FOR##R(BOOST_PP_LIST_FOR_EACH_PRODUCT_I_H(P),BOOST_PP_LIST_FOR_EACH_PRODUCT_C,BOOST_PP_LIST_FOR_EACH_PRODUCT_F,BOOST_PP_LIST_FOR_EACH_PRODUCT_I23)
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I22(R,P) BOOST_PP_LIST_FOR_EACH_PRODUCT_I_C(P,22)(R,P)
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I23_C(R,P) BOOST_PP_FOR##R(BOOST_PP_LIST_FOR_EACH_PRODUCT_I_H(P),BOOST_PP_LIST_FOR_EACH_PRODUCT_C,BOOST_PP_LIST_FOR_EACH_PRODUCT_F,BOOST_PP_LIST_FOR_EACH_PRODUCT_I24)
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I23(R,P) BOOST_PP_LIST_FOR_EACH_PRODUCT_I_C(P,23)(R,P)
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I24_C(R,P) BOOST_PP_FOR##R(BOOST_PP_LIST_FOR_EACH_PRODUCT_I_H(P),BOOST_PP_LIST_FOR_EACH_PRODUCT_C,BOOST_PP_LIST_FOR_EACH_PRODUCT_F,BOOST_PP_LIST_FOR_EACH_PRODUCT_I25)
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I24(R,P) BOOST_PP_LIST_FOR_EACH_PRODUCT_I_C(P,24)(R,P)
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I25_C(R,P) BOOST_PP_FOR##R(BOOST_PP_LIST_FOR_EACH_PRODUCT_I_H(P),BOOST_PP_LIST_FOR_EACH_PRODUCT_C,BOOST_PP_LIST_FOR_EACH_PRODUCT_F,BOOST_PP_LIST_FOR_EACH_PRODUCT_I26)
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I25(R,P) BOOST_PP_LIST_FOR_EACH_PRODUCT_I_C(P,25)(R,P)
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I26_C(R,P) BOOST_PP_FOR##R(BOOST_PP_LIST_FOR_EACH_PRODUCT_I_H(P),BOOST_PP_LIST_FOR_EACH_PRODUCT_C,BOOST_PP_LIST_FOR_EACH_PRODUCT_F,BOOST_PP_LIST_FOR_EACH_PRODUCT_I27)
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I26(R,P) BOOST_PP_LIST_FOR_EACH_PRODUCT_I_C(P,26)(R,P)
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I27_C(R,P) BOOST_PP_FOR##R(BOOST_PP_LIST_FOR_EACH_PRODUCT_I_H(P),BOOST_PP_LIST_FOR_EACH_PRODUCT_C,BOOST_PP_LIST_FOR_EACH_PRODUCT_F,BOOST_PP_LIST_FOR_EACH_PRODUCT_I28)
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I27(R,P) BOOST_PP_LIST_FOR_EACH_PRODUCT_I_C(P,27)(R,P)
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I28_C(R,P) BOOST_PP_FOR##R(BOOST_PP_LIST_FOR_EACH_PRODUCT_I_H(P),BOOST_PP_LIST_FOR_EACH_PRODUCT_C,BOOST_PP_LIST_FOR_EACH_PRODUCT_F,BOOST_PP_LIST_FOR_EACH_PRODUCT_I29)
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I28(R,P) BOOST_PP_LIST_FOR_EACH_PRODUCT_I_C(P,28)(R,P)
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I29_C(R,P) BOOST_PP_FOR##R(BOOST_PP_LIST_FOR_EACH_PRODUCT_I_H(P),BOOST_PP_LIST_FOR_EACH_PRODUCT_C,BOOST_PP_LIST_FOR_EACH_PRODUCT_F,BOOST_PP_LIST_FOR_EACH_PRODUCT_I30)
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I29(R,P) BOOST_PP_LIST_FOR_EACH_PRODUCT_I_C(P,29)(R,P)
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I30_C(R,P) BOOST_PP_FOR##R(BOOST_PP_LIST_FOR_EACH_PRODUCT_I_H(P),BOOST_PP_LIST_FOR_EACH_PRODUCT_C,BOOST_PP_LIST_FOR_EACH_PRODUCT_F,BOOST_PP_LIST_FOR_EACH_PRODUCT_I31)
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I30(R,P) BOOST_PP_LIST_FOR_EACH_PRODUCT_I_C(P,30)(R,P)
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I31_C(R,P) BOOST_PP_FOR##R(BOOST_PP_LIST_FOR_EACH_PRODUCT_I_H(P),BOOST_PP_LIST_FOR_EACH_PRODUCT_C,BOOST_PP_LIST_FOR_EACH_PRODUCT_F,BOOST_PP_LIST_FOR_EACH_PRODUCT_I32)
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I31(R,P) BOOST_PP_LIST_FOR_EACH_PRODUCT_I_C(P,31)(R,P)
|
||||
#endif
|
@ -1,52 +0,0 @@
|
||||
#ifndef BOOST_PREPROCESSOR_LIST_REST_N_HPP
|
||||
#define BOOST_PREPROCESSOR_LIST_REST_N_HPP
|
||||
|
||||
/* Copyright (C) 2001
|
||||
* Housemarque Oy
|
||||
* http://www.housemarque.com
|
||||
*
|
||||
* Permission to copy, use, modify, sell and distribute this software is
|
||||
* granted provided this copyright notice appears in all copies. This
|
||||
* software is provided "as is" without express or implied warranty, and
|
||||
* with no claim as to its suitability for any purpose.
|
||||
*
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
#include <boost/preprocessor/dec.hpp>
|
||||
#include <boost/preprocessor/list/adt.hpp>
|
||||
#include <boost/preprocessor/while.hpp>
|
||||
|
||||
/** <p>Expands to a list of all but the first <code>COUNT</code> elements of the
|
||||
list <code>LIST</code>.</p>
|
||||
|
||||
<p>For example,</p>
|
||||
|
||||
<pre>
|
||||
BOOST_PP_LIST_REST_N(2,BOOST_PP_TUPLE_TO_LIST(4,(+,-,*,/)))
|
||||
</pre>
|
||||
|
||||
<p>expands to the same as:</p>
|
||||
|
||||
<pre>
|
||||
BOOST_PP_TUPLE_TO_LIST(2,(*,/))
|
||||
</pre>
|
||||
|
||||
<h3>See</h3>
|
||||
<ul>
|
||||
<li>BOOST_PP_LIST_FIRST_N()</li>
|
||||
</ul>
|
||||
|
||||
<h3>Test</h3>
|
||||
<ul>
|
||||
<li><a href="../../test/list_test.cpp">list_test.cpp</a></li>
|
||||
</ul>
|
||||
*/
|
||||
#define BOOST_PP_LIST_REST_N(COUNT,LIST) BOOST_PP_LIST_REST_N_D(0,COUNT,LIST)
|
||||
|
||||
/** <p>Can be used inside BOOST_PP_WHILE() (see for an explanation of the D parameter).</p> */
|
||||
#define BOOST_PP_LIST_REST_N_D(D,COUNT,LIST) BOOST_PP_TUPLE_ELEM(2,0,BOOST_PP_WHILE##D(BOOST_PP_LIST_REST_N_C,BOOST_PP_LIST_REST_N_F,(LIST,COUNT)))
|
||||
|
||||
#define BOOST_PP_LIST_REST_N_C(D,LC) BOOST_PP_TUPLE_ELEM(2,1,LC)
|
||||
#define BOOST_PP_LIST_REST_N_F(D,LC) (BOOST_PP_TUPLE_ELEM(3,1,BOOST_PP_TUPLE_ELEM(2,0,LC)),BOOST_PP_DEC(BOOST_PP_TUPLE_ELEM(2,1,LC)))
|
||||
#endif
|
@ -1,42 +0,0 @@
|
||||
#ifndef BOOST_PREPROCESSOR_LIST_REVERSE_HPP
|
||||
#define BOOST_PREPROCESSOR_LIST_REVERSE_HPP
|
||||
|
||||
/* Copyright (C) 2001
|
||||
* Housemarque Oy
|
||||
* http://www.housemarque.com
|
||||
*
|
||||
* Permission to copy, use, modify, sell and distribute this software is
|
||||
* granted provided this copyright notice appears in all copies. This
|
||||
* software is provided "as is" without express or implied warranty, and
|
||||
* with no claim as to its suitability for any purpose.
|
||||
*
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
#include <boost/preprocessor/list/fold_left.hpp>
|
||||
|
||||
/** <p>List reversal.</p>
|
||||
|
||||
<p>For example,</p>
|
||||
|
||||
<pre>
|
||||
BOOST_PP_LIST_REVERSE(BOOST_PP_TUPLE_TO_LIST(3,(A,B,C)))
|
||||
</pre>
|
||||
|
||||
<p>expands to the same as:</p>
|
||||
|
||||
<pre>
|
||||
BOOST_PP_TUPLE_TO_LIST(3,(C,B,A))
|
||||
</pre>
|
||||
|
||||
<h3>Test</h3>
|
||||
<ul>
|
||||
<li><a href="../../test/list_test.cpp">list_test.cpp</a></li>
|
||||
</ul>
|
||||
*/
|
||||
#define BOOST_PP_LIST_REVERSE(LIST) BOOST_PP_LIST_REVERSE_D(0,LIST)
|
||||
|
||||
/** <p>Can be used inside BOOST_PP_WHILE() (see for an explanation of the D parameter).</p> */
|
||||
#define BOOST_PP_LIST_REVERSE_D(D,LIST) BOOST_PP_LIST_FOLD_LEFT_D(D,BOOST_PP_LIST_REVERSE_F,(_,_,0),LIST)
|
||||
#define BOOST_PP_LIST_REVERSE_F(D,S,X) (X,S,1)
|
||||
#endif
|
@ -1,39 +0,0 @@
|
||||
#ifndef BOOST_PREPROCESSOR_LIST_SIZE_HPP
|
||||
#define BOOST_PREPROCESSOR_LIST_SIZE_HPP
|
||||
|
||||
/* Copyright (C) 2001
|
||||
* Housemarque Oy
|
||||
* http://www.housemarque.com
|
||||
*
|
||||
* Permission to copy, use, modify, sell and distribute this software is
|
||||
* granted provided this copyright notice appears in all copies. This
|
||||
* software is provided "as is" without express or implied warranty, and
|
||||
* with no claim as to its suitability for any purpose.
|
||||
*
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
#include <boost/preprocessor/list/fold_left.hpp>
|
||||
#include <boost/preprocessor/inc.hpp>
|
||||
|
||||
/** <p>Expands to the number of elements in the list.</p>
|
||||
|
||||
<p>For example,</p>
|
||||
|
||||
<pre>
|
||||
BOOST_PP_LIST_SIZE(BOOST_PP_TUPLE_TO_LIST(3,(A,B,C)))
|
||||
</pre>
|
||||
|
||||
<p>expands to <code>3</code>.</p>
|
||||
|
||||
<h3>Test</h3>
|
||||
<ul>
|
||||
<li><a href="../../test/list_test.cpp">list_test.cpp</a></li>
|
||||
</ul>
|
||||
*/
|
||||
#define BOOST_PP_LIST_SIZE(LIST) BOOST_PP_LIST_SIZE_D(0,LIST)
|
||||
|
||||
/** <p>Can be used inside BOOST_PP_WHILE() (see for an explanation of the D parameter).</p> */
|
||||
#define BOOST_PP_LIST_SIZE_D(D,LIST) BOOST_PP_LIST_FOLD_LEFT_D(D,BOOST_PP_LIST_SIZE_F,0,LIST)
|
||||
#define BOOST_PP_LIST_SIZE_F(D,S,X) BOOST_PP_INC(S)
|
||||
#endif
|
@ -1,43 +0,0 @@
|
||||
#ifndef BOOST_PREPROCESSOR_LIST_TO_TUPLE_HPP
|
||||
#define BOOST_PREPROCESSOR_LIST_TO_TUPLE_HPP
|
||||
|
||||
/* Copyright (C) 2001
|
||||
* Housemarque Oy
|
||||
* http://www.housemarque.com
|
||||
*
|
||||
* Permission to copy, use, modify, sell and distribute this software is
|
||||
* granted provided this copyright notice appears in all copies. This
|
||||
* software is provided "as is" without express or implied warranty, and
|
||||
* with no claim as to its suitability for any purpose.
|
||||
*
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
#include <boost/preprocessor/list/enum.hpp>
|
||||
|
||||
/** <p>Converts the list to a tuple.</p>
|
||||
|
||||
<p>For example,</p>
|
||||
|
||||
<pre>
|
||||
BOOST_PP_LIST_TO_TUPLE(BOOST_PP_TUPLE_TO_LIST(3,(A,B,C)))
|
||||
</pre>
|
||||
|
||||
<p>expands to <code>(A,B,C)</code>.</p>
|
||||
|
||||
<h3>Note</h3>
|
||||
<ul>
|
||||
<li>The supported size of the list being converted to a tuple is limited by
|
||||
BOOST_PP_LIMIT_MAG rather than BOOST_PP_LIMIT_TUPLE.</li>
|
||||
</ul>
|
||||
|
||||
<h3>Test</h3>
|
||||
<ul>
|
||||
<li><a href="../../test/list_test.cpp">list_test.cpp</a></li>
|
||||
</ul>
|
||||
*/
|
||||
#define BOOST_PP_LIST_TO_TUPLE(LIST) BOOST_PP_LIST_TO_TUPLE_R(0,LIST)
|
||||
|
||||
/** <p>Can be used inside BOOST_PP_FOR() (see for an explanation of the R parameter).</p> */
|
||||
#define BOOST_PP_LIST_TO_TUPLE_R(R,LIST) (BOOST_PP_LIST_ENUM_R(R,LIST))
|
||||
#endif
|
@ -1,54 +0,0 @@
|
||||
#ifndef BOOST_PREPROCESSOR_LIST_TRANSFORM_HPP
|
||||
#define BOOST_PREPROCESSOR_LIST_TRANSFORM_HPP
|
||||
|
||||
/* Copyright (C) 2001
|
||||
* Housemarque Oy
|
||||
* http://www.housemarque.com
|
||||
*
|
||||
* Permission to copy, use, modify, sell and distribute this software is
|
||||
* granted provided this copyright notice appears in all copies. This
|
||||
* software is provided "as is" without express or implied warranty, and
|
||||
* with no claim as to its suitability for any purpose.
|
||||
*
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
#include <boost/preprocessor/list/fold_right.hpp>
|
||||
|
||||
/** <p>Applies the macro <code>OP(D,DATA,X)</code> to each element <code>X</code>
|
||||
of the list producing a new list.</p>
|
||||
|
||||
<p>In other words, expands to:</p>
|
||||
|
||||
<pre>
|
||||
BOOST_PP_LIST_CONS(OP(D,DATA,BOOST_PP_LIST_AT(LIST,0)),
|
||||
BOOST_PP_LIST_CONS(OP(D,DATA,BOOST_PP_LIST_AT(LIST,1)),
|
||||
...
|
||||
BOOST_PP_LIST_CONS(OP(D,DATA,BOOST_PP_LIST_AT(LIST,BOOST_PP_DEC(BOOST_PP_LIST_SIZE(LIST)))),
|
||||
BOOST_PP_LIST_NIL) ... ))
|
||||
</pre>
|
||||
|
||||
<p>For example,</p>
|
||||
|
||||
<pre>
|
||||
BOOST_PP_LIST_TRANSFORM(BOOST_PP_ADD_D,2,BOOST_PP_TUPLE_TO_LIST(2,(1,2)))
|
||||
</pre>
|
||||
|
||||
<p>expands to the same as:</p>
|
||||
|
||||
<pre>
|
||||
BOOST_PP_TUPLE_TO_LIST(2,(3,4))
|
||||
</pre>
|
||||
|
||||
<h3>Test</h3>
|
||||
<ul>
|
||||
<li><a href="../../test/list_test.cpp">list_test.cpp</a></li>
|
||||
</ul>
|
||||
*/
|
||||
#define BOOST_PP_LIST_TRANSFORM(OP,DATA,LIST) BOOST_PP_LIST_TRANSFORM_D(0,OP,DATA,LIST)
|
||||
|
||||
/** <p>Can be used inside BOOST_PP_WHILE() (see for an explanation of the D parameter).</p> */
|
||||
#define BOOST_PP_LIST_TRANSFORM_D(D,OP,DATA,LIST) BOOST_PP_TUPLE_ELEM(3,2,BOOST_PP_LIST_FOLD_RIGHT_D(D,BOOST_PP_LIST_TRANSFORM_F,LIST,(OP,DATA,(_,_,0))))
|
||||
|
||||
#define BOOST_PP_LIST_TRANSFORM_F(D,X,ODR) (BOOST_PP_TUPLE_ELEM(3,0,ODR),BOOST_PP_TUPLE_ELEM(3,1,ODR),(BOOST_PP_TUPLE_ELEM(3,0,ODR)(D,BOOST_PP_TUPLE_ELEM(3,1,ODR),X),BOOST_PP_TUPLE_ELEM(3,2,ODR),1))
|
||||
#endif
|
Reference in New Issue
Block a user