C++ Boost

Boost.Preprocessor

Header <boost/preprocessor/enum_shifted.hpp>


Prev Next Macros Headers

#define BOOST_PP_ENUM_SHIFTED(COUNT,MACRO,DATA)

Generates a comma separated shifted list.

In other words, expands to the sequence:

MACRO(1,DATA), MACRO(2,DATA), ..., MACRO(BOOST_PP_DEC(COUNT),DATA)

For example,

#define TYPED_PARAM(INDEX,DATA)\
  BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2,0,DATA),INDEX) BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2,1,DATA),INDEX)
BOOST_PP_ENUM_SHIFTED(3,TYPED_PARAM,(X,x))

expands to:

X1 x1, X2 x2

Uses


Prev Next Macros Headers

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.