|
Boost.PreprocessorHeader <boost/preprocessor/list/for_each_product.hpp> |
Repeats MACRO(R,X)
for each element X
of the
cartesian product of the lists of the SIZE_OF_TUPLE
-tuple TUPLE_OF_LISTS
.
This macro is useful for generating code to avoid combinatorial explosion.
For example,
#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)) ) )
expands to:
(A,1) (A,2) (B,1) (B,2) (C,1) (C,2)
Can be used inside BOOST_PP_FOR() (see for an explanation of the R parameter).
Revised
© Copyright Housemarque Oy 2002
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.