Карта сайта Kansoftware
НОВОСТИУСЛУГИРЕШЕНИЯКОНТАКТЫ
Разработка программного обеспечения

BOOST_PP_LIST_FOR_EACH_I

Boost , ,

The BOOST_PP_LIST_FOR_EACH_I macro repeats a macro for each element in a list.

Usage

BOOST_PP_LIST_FOR_EACH_I(macro, data, list)

Arguments

macro
A macro of the form macro(r, data, i, elem).  This macro is expanded by BOOST_PP_LIST_FOR_EACH_I with each element in list.  It is expanded with the next available BOOST_PP_FOR repetition, the auxiliary data, the index of the current element, and the current element.
data
Auxiliary data passed to macro.
list
The list for which macro will be invoked on each element.

Remarks

This macro is a repetition construct.  If list is (a, (b, (c, BOOST_PP_NIL))), it expands to the sequence:
macro(r, data, 0, a) macro(r, data, 1, b) macro(r, data, 2, c)
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_I_R in such a situation.

See Also

Requirements

Header:  <boost/preprocessor/list/for_each_i.hpp>

Sample Code

#include <boost/preprocessor/cat.hpp>
#include <boost/preprocessor/list/for_each_i.hpp>
#define LIST (w, (x, (y, (z, BOOST_PP_NIL))))
#define MACRO(r, data, i, elem) BOOST_PP_CAT(elem, BOOST_PP_CAT(data, i))
BOOST_PP_LIST_FOR_EACH_I(MACRO, _, LIST) // expands to w_0 x_1 y_2 z_3

© 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_I раздела может быть полезна для разработчиков на c++ и boost.




Материалы статей собраны из открытых источников, владелец сайта не претендует на авторство. Там где авторство установить не удалось, материал подаётся без имени автора. В случае если Вы считаете, что Ваши права нарушены, пожалуйста, свяжитесь с владельцем сайта.



:: Главная :: ::


реклама


©KANSoftWare (разработка программного обеспечения, создание программ, создание интерактивных сайтов), 2007
Top.Mail.Ru

Время компиляции файла: 2024-08-30 11:47:00
2025-05-22 05:54:36/0.0030679702758789/0