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

BOOST_PP_REPEAT_z

Boost , ,

The BOOST_PP_REPEAT_z macro represents a reentry into the BOOST_PP_REPEAT repetition construct.

Usage

BOOST_PP_REPEAT_ ## z(count, macro, data)

Arguments

z
The next available BOOST_PP_REPEAT dimension.
count
The number of repetitious calls to macro.  Valid values range from 0 to BOOST_PP_LIMIT_REPEAT.
macro
A ternary operation of the form macro(z, n, data).  This macro is expanded by BOOST_PP_REPEAT with the next available repetition depth, the current repetition number, and the auxiliary data argument. 
data
Auxiliary data passed to macro.

Remarks

This macro expands to the sequence:
macro(z, 0, data) macro(z, 1, data) ... macro(z, count - 1, data)
At certain times, it may be necessary to perform the concatenation with BOOST_PP_CAT rather than the preprocessor token-pasting operator.  This happens when the z value is a macro invocation itself.  It needs a delay to allow it to expand.  The syntax in such a scenario becomes:
BOOST_PP_CAT(BOOST_PP_REPEAT_, z)(count, macro, data)

See Also

Requirements

Header:  <boost/preprocessor/repetition/repeat.hpp>

Sample Code

#include <boost/preprocessor/arithmetic/inc.hpp>
#include <boost/preprocessor/punctuation/comma_if.hpp>
#include <boost/preprocessor/repetition/repeat.hpp>
#define TEXT(z, n, text) BOOST_PP_COMMA_IF(n) text
#define TEMPLATE(z, n, _) \
   BOOST_PP_COMMA_IF(n) \
   template< \
      BOOST_PP_REPEAT_ ## z( \
         BOOST_PP_INC(n), \
         TEXT, class \
      ) \
   > class T ## n \
   /**/
BOOST_PP_REPEAT(3, TEMPLATE, nil)
   /*
   expands to:
      template<class> class T0,
      template<class, class> class T1,
      template<class, class, class> class T2
   */

© Copyright Housemarque Oy 2002
© Copyright Paul Mensonides 2002
© Copyright Edward Diener 2014

Распространяется в соответствии с лицензией Boost Software License, Version 1.0. (См. сопроводительный файл)LICENSE_1_0.txtили копия наwww.boost.org/LICENSE_1_0.txt

Статья BOOST_PP_REPEAT_z раздела может быть полезна для разработчиков на c++ и boost.




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



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


реклама


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

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