![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
BOOST_PP_LIST_FOR_EACH_PRODUCTBoost , ,
The BOOST_PP_LIST_FOR_EACH_PRODUCT macro repeats a macro for each cartesian product of several lists.
Usage
BOOST_PP_LIST_FOR_EACH_PRODUCT(macro, size, tuple)
Arguments
Remarks
This macro is a repetition construct.
If two lists are (a, (b, (c, BOOST_PP_NIL))) and (x, (y, (z, BOOST_PP_NIL))),
this macro will produce the following sequence:
macro(r, (a, x))
macro(r, (a, y))
macro(r, (a, z))
macro(r, (b, x)) macro(r, (b, y)) macro(r, (b, z)) macro(r, (c, x)) macro(r, (c, y)) macro(r, (c, z))
Previously, this macro could not be used inside BOOST_PP_FOR.
There is no longer any such restriction.
It is more efficient, however, to use BOOST_PP_LIST_FOR_EACH_PRODUCT_R in such a situation.
See AlsoRequirementsSample Code#include <boost/preprocessor/list/for_each_product.hpp> #define L1 (a, (b, (c, BOOST_PP_NIL))) #define L2 (x, (y, (z, BOOST_PP_NIL))) #define MACRO(r, product) product BOOST_PP_LIST_FOR_EACH_PRODUCT(MACRO, 2, (L1, L2)) // expands to (a, x) (a, y) (a, z) (b, x) (b, y) (b, z) (c, x) (c, y) (c, z)
© Copyright Housemarque Oy 2002
© Copyright Paul Mensonides 2002
Распространяется в соответствии с лицензией Boost Software License, Version 1.0. (См. сопроводительный файл)LICENSE_1_0.txtили копия наwww.boost.org/LICENSE_1_0.txt Статья BOOST_PP_LIST_FOR_EACH_PRODUCT раздела может быть полезна для разработчиков на c++ и boost. Материалы статей собраны из открытых источников, владелец сайта не претендует на авторство. Там где авторство установить не удалось, материал подаётся без имени автора. В случае если Вы считаете, что Ваши права нарушены, пожалуйста, свяжитесь с владельцем сайта. :: Главная :: ::
|
||||
©KANSoftWare (разработка программного обеспечения, создание программ, создание интерактивных сайтов), 2007 |