From e8cd3315e0719e418487e557687a47638ce3e19f Mon Sep 17 00:00:00 2001 From: Paul Mensonides Date: Wed, 18 Sep 2002 19:43:48 +0000 Subject: [PATCH] added trailing binary parameters [SVN r15443] --- include/boost/preprocessor/repetition.hpp | 1 + .../enum_trailing_binary_params.hpp | 54 +++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 include/boost/preprocessor/repetition/enum_trailing_binary_params.hpp diff --git a/include/boost/preprocessor/repetition.hpp b/include/boost/preprocessor/repetition.hpp index b1f6ec0..76d7b59 100644 --- a/include/boost/preprocessor/repetition.hpp +++ b/include/boost/preprocessor/repetition.hpp @@ -23,6 +23,7 @@ # include # include # include +# include # include # include # include diff --git a/include/boost/preprocessor/repetition/enum_trailing_binary_params.hpp b/include/boost/preprocessor/repetition/enum_trailing_binary_params.hpp new file mode 100644 index 0000000..c2cfd7c --- /dev/null +++ b/include/boost/preprocessor/repetition/enum_trailing_binary_params.hpp @@ -0,0 +1,54 @@ +# /* ************************************************************************** +# * * +# * (C) Copyright Paul Mensonides 2002. Permission to copy, use, * +# * modify, sell, and distribute this software is granted provided * +# * this copyright notice appears in all copies. This software is * +# * provided "as is" without express or implied warranty, and with * +# * no claim at to its suitability for any purpose. * +# * * +# ************************************************************************** */ +# +# /* See http://www.boost.org for most recent version. */ +# +# ifndef BOOST_PREPROCESSOR_REPETITION_ENUM_TRAILING_BINARY_PARAMS_HPP +# define BOOST_PREPROCESSOR_REPETITION_ENUM_TRAILING_BINARY_PARAMS_HPP +# +# include +# include +# include +# include +# include +# +# /* BOOST_PP_ENUM_TRAILING_BINARY_PARAMS */ +# +# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG() +# define BOOST_PP_ENUM_TRAILING_BINARY_PARAMS(count, p1, p2) BOOST_PP_REPEAT(count, BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_M, (p1, p2)) +# else +# define BOOST_PP_ENUM_TRAILING_BINARY_PARAMS(count, p1, p2) BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_I(count, p1, p2) +# define BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_I(count, p1, p2) BOOST_PP_REPEAT(count, BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_M, (p1, p2)) +# endif +# +# if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_STRICT() +# define BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_M(z, n, pp) BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_M_IM(z, n, BOOST_PP_TUPLE_REM_2 pp) +# define BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_M_IM(z, n, im) BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_M_I(z, n, im) +# else +# define BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_M(z, n, pp) BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_M_I(z, n, BOOST_PP_TUPLE_ELEM(2, 0, pp), BOOST_PP_TUPLE_ELEM(2, 1, pp)) +# endif +# +# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MSVC() +# define BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_M_I(z, n, p1, p2) BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_M_II(z, n, p1, p2) +# define BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_M_II(z, n, p1, p2) , p1 ## n p2 ## n +# else +# define BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_M_I(z, n, p1, p2) , BOOST_PP_CAT(p1, n) BOOST_PP_CAT(p2, n) +# endif +# +# /* BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_Z */ +# +# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG() +# define BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_Z(z, count, p1, p2) BOOST_PP_REPEAT_ ## z(count, BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_M, (p1, p2)) +# else +# define BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_Z(z, count, p1, p2) BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_Z_I(z, count, p1, p2) +# define BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_Z_I(z, count, p1, p2) BOOST_PP_REPEAT_ ## z(count, BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_M, (p1, p2)) +# endif +# +# endif