1.1 --- a/epoc32/include/stdapis/boost/mpl/apply.hpp Wed Mar 31 12:27:01 2010 +0100
1.2 +++ b/epoc32/include/stdapis/boost/mpl/apply.hpp Wed Mar 31 12:33:34 2010 +0100
1.3 @@ -1,34 +1,225 @@
1.4 -# /* **************************************************************************
1.5 -# * *
1.6 -# * (C) Copyright Paul Mensonides 2002.
1.7 -# * Distributed under the Boost Software License, Version 1.0. (See
1.8 -# * accompanying file LICENSE_1_0.txt or copy at
1.9 -# * http://www.boost.org/LICENSE_1_0.txt)
1.10 -# * *
1.11 -# ************************************************************************** */
1.12 -#
1.13 -# /* See http://www.boost.org for most recent version. */
1.14 -#
1.15 -# ifndef BOOST_PREPROCESSOR_FACILITIES_APPLY_HPP
1.16 -# define BOOST_PREPROCESSOR_FACILITIES_APPLY_HPP
1.17 -#
1.18 -# include <boost/preprocessor/config/config.hpp>
1.19 -# include <boost/preprocessor/control/expr_iif.hpp>
1.20 -# include <boost/preprocessor/detail/is_unary.hpp>
1.21 -# include <boost/preprocessor/tuple/rem.hpp>
1.22 -#
1.23 -# /* BOOST_PP_APPLY */
1.24 -#
1.25 -# if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
1.26 -# define BOOST_PP_APPLY(x) BOOST_PP_APPLY_I(x)
1.27 -# define BOOST_PP_APPLY_I(x) BOOST_PP_EXPR_IIF(BOOST_PP_IS_UNARY(x), BOOST_PP_TUPLE_REM_1 x)
1.28 -# elif BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_BCC()
1.29 -# define BOOST_PP_APPLY(x) BOOST_PP_APPLY_I(x)
1.30 -# define BOOST_PP_APPLY_I(x) BOOST_PP_APPLY_ ## x
1.31 -# define BOOST_PP_APPLY_(x) x
1.32 -# define BOOST_PP_APPLY_BOOST_PP_NIL
1.33 -# else
1.34 -# define BOOST_PP_APPLY(x) BOOST_PP_EXPR_IIF(BOOST_PP_IS_UNARY(x), BOOST_PP_TUPLE_REM_1 x)
1.35 -# endif
1.36 -#
1.37 -# endif
1.38 +
1.39 +#if !defined(BOOST_PP_IS_ITERATING)
1.40 +
1.41 +///// header body
1.42 +
1.43 +#ifndef BOOST_MPL_APPLY_HPP_INCLUDED
1.44 +#define BOOST_MPL_APPLY_HPP_INCLUDED
1.45 +
1.46 +// Copyright Aleksey Gurtovoy 2000-2004
1.47 +//
1.48 +// Distributed under the Boost Software License, Version 1.0.
1.49 +// (See accompanying file LICENSE_1_0.txt or copy at
1.50 +// http://www.boost.org/LICENSE_1_0.txt)
1.51 +//
1.52 +// See http://www.boost.org/libs/mpl for documentation.
1.53 +
1.54 +// $Source: /cvsroot/boost/boost/boost/mpl/apply.hpp,v $
1.55 +// $Date: 2004/09/02 15:40:41 $
1.56 +// $Revision: 1.17 $
1.57 +
1.58 +#if !defined(BOOST_MPL_PREPROCESSING_MODE)
1.59 +# include <boost/mpl/apply_fwd.hpp>
1.60 +# include <boost/mpl/apply_wrap.hpp>
1.61 +# include <boost/mpl/placeholders.hpp>
1.62 +# include <boost/mpl/lambda.hpp>
1.63 +# include <boost/mpl/aux_/na.hpp>
1.64 +# include <boost/mpl/aux_/lambda_support.hpp>
1.65 +#endif
1.66 +
1.67 +#include <boost/mpl/aux_/config/use_preprocessed.hpp>
1.68 +
1.69 +#if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \
1.70 + && !defined(BOOST_MPL_PREPROCESSING_MODE)
1.71 +
1.72 +# define BOOST_MPL_PREPROCESSED_HEADER apply.hpp
1.73 +# include <boost/mpl/aux_/include_preprocessed.hpp>
1.74 +
1.75 +#else
1.76 +
1.77 +# include <boost/mpl/limits/arity.hpp>
1.78 +# include <boost/mpl/aux_/preprocessor/params.hpp>
1.79 +# include <boost/mpl/aux_/preprocessor/default_params.hpp>
1.80 +# include <boost/mpl/aux_/preprocessor/partial_spec_params.hpp>
1.81 +# include <boost/mpl/aux_/preprocessor/enum.hpp>
1.82 +# include <boost/mpl/aux_/config/lambda.hpp>
1.83 +# include <boost/mpl/aux_/config/dtp.hpp>
1.84 +# include <boost/mpl/aux_/nttp_decl.hpp>
1.85 +# include <boost/mpl/aux_/config/eti.hpp>
1.86 +# include <boost/mpl/aux_/config/msvc.hpp>
1.87 +# include <boost/mpl/aux_/config/workaround.hpp>
1.88 +
1.89 +# include <boost/preprocessor/comma_if.hpp>
1.90 +# include <boost/preprocessor/inc.hpp>
1.91 +# include <boost/preprocessor/iterate.hpp>
1.92 +# include <boost/preprocessor/cat.hpp>
1.93 +
1.94 +namespace boost { namespace mpl {
1.95 +
1.96 +// local macros, #undef-ined at the end of the header
1.97 +# define AUX778076_APPLY_PARAMS(param) \
1.98 + BOOST_MPL_PP_PARAMS( \
1.99 + BOOST_MPL_LIMIT_METAFUNCTION_ARITY \
1.100 + , param \
1.101 + ) \
1.102 + /**/
1.103 +
1.104 +# define AUX778076_APPLY_DEF_PARAMS(param, value) \
1.105 + BOOST_MPL_PP_DEFAULT_PARAMS( \
1.106 + BOOST_MPL_LIMIT_METAFUNCTION_ARITY \
1.107 + , param \
1.108 + , value \
1.109 + ) \
1.110 + /**/
1.111 +
1.112 +# define AUX778076_APPLY_N_PARAMS(n, param) \
1.113 + BOOST_MPL_PP_PARAMS(n, param) \
1.114 + /**/
1.115 +
1.116 +# define AUX778076_APPLY_N_COMMA_PARAMS(n, param) \
1.117 + BOOST_PP_COMMA_IF(n) \
1.118 + BOOST_MPL_PP_PARAMS(n, param) \
1.119 + /**/
1.120 +
1.121 +# define AUX778076_APPLY_N_PARTIAL_SPEC_PARAMS(n, param, def) \
1.122 + BOOST_PP_COMMA_IF(n) \
1.123 + BOOST_MPL_PP_PARTIAL_SPEC_PARAMS(n, param, def) \
1.124 + /**/
1.125 +
1.126 +# define AUX778076_APPLY_N_SPEC_PARAMS(n, param) \
1.127 + BOOST_MPL_PP_ENUM(BOOST_PP_INC(n), param) \
1.128 + /**/
1.129 +
1.130 +
1.131 +#define BOOST_PP_ITERATION_PARAMS_1 \
1.132 + (3,(0, BOOST_MPL_LIMIT_METAFUNCTION_ARITY, <boost/mpl/apply.hpp>))
1.133 +#include BOOST_PP_ITERATE()
1.134 +
1.135 +# if !defined(BOOST_MPL_CFG_NO_APPLY_TEMPLATE)
1.136 +// real C++ version is already taken care of
1.137 +# if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
1.138 +
1.139 +namespace aux {
1.140 +// apply_count_args
1.141 +#define AUX778076_COUNT_ARGS_PREFIX apply
1.142 +#define AUX778076_COUNT_ARGS_DEFAULT na
1.143 +#define AUX778076_COUNT_ARGS_ARITY BOOST_MPL_LIMIT_METAFUNCTION_ARITY
1.144 +#include <boost/mpl/aux_/count_args.hpp>
1.145 +}
1.146 +
1.147 +
1.148 +template<
1.149 + typename F, AUX778076_APPLY_DEF_PARAMS(typename T, na)
1.150 + >
1.151 +struct apply
1.152 + : aux::apply_chooser<
1.153 + aux::apply_count_args< AUX778076_APPLY_PARAMS(T) >::value
1.154 + >::template result_< F, AUX778076_APPLY_PARAMS(T) >::type
1.155 +{
1.156 +};
1.157 +
1.158 +# endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
1.159 +# endif // BOOST_MPL_CFG_NO_APPLY_TEMPLATE
1.160 +
1.161 +# undef AUX778076_APPLY_N_SPEC_PARAMS
1.162 +# undef AUX778076_APPLY_N_PARTIAL_SPEC_PARAMS
1.163 +# undef AUX778076_APPLY_N_COMMA_PARAMS
1.164 +# undef AUX778076_APPLY_N_PARAMS
1.165 +# undef AUX778076_APPLY_DEF_PARAMS
1.166 +# undef AUX778076_APPLY_PARAMS
1.167 +
1.168 +}}
1.169 +
1.170 +#endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
1.171 +#endif // BOOST_MPL_APPLY_HPP_INCLUDED
1.172 +
1.173 +///// iteration, depth == 1
1.174 +
1.175 +#elif BOOST_PP_ITERATION_DEPTH() == 1
1.176 +
1.177 +# define i_ BOOST_PP_FRAME_ITERATION(1)
1.178 +
1.179 +template<
1.180 + typename F AUX778076_APPLY_N_COMMA_PARAMS(i_, typename T)
1.181 + >
1.182 +struct BOOST_PP_CAT(apply,i_)
1.183 +#if !BOOST_WORKAROUND(BOOST_MSVC, < 1300)
1.184 + : BOOST_PP_CAT(apply_wrap,i_)<
1.185 + typename lambda<F>::type
1.186 + AUX778076_APPLY_N_COMMA_PARAMS(i_, T)
1.187 + >
1.188 +{
1.189 +#else
1.190 +{
1.191 + typedef typename BOOST_PP_CAT(apply_wrap,i_)<
1.192 + typename lambda<F>::type
1.193 + AUX778076_APPLY_N_COMMA_PARAMS(i_, T)
1.194 + >::type type;
1.195 +#endif
1.196 + BOOST_MPL_AUX_LAMBDA_SUPPORT(
1.197 + BOOST_PP_INC(i_)
1.198 + , BOOST_PP_CAT(apply,i_)
1.199 + , (F AUX778076_APPLY_N_COMMA_PARAMS(i_,T))
1.200 + )
1.201 +};
1.202 +
1.203 +
1.204 +#if defined(BOOST_MPL_CFG_MSVC_ETI_BUG)
1.205 +/// workaround for ETI bug
1.206 +template<>
1.207 +struct BOOST_PP_CAT(apply,i_)<AUX778076_APPLY_N_SPEC_PARAMS(i_, int)>
1.208 +{
1.209 + typedef int type;
1.210 +};
1.211 +#endif
1.212 +
1.213 +# if !defined(BOOST_MPL_CFG_NO_APPLY_TEMPLATE)
1.214 +# if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
1.215 +
1.216 +#if i_ == BOOST_MPL_LIMIT_METAFUNCTION_ARITY
1.217 +/// primary template (not a specialization!)
1.218 +template<
1.219 + typename F AUX778076_APPLY_N_COMMA_PARAMS(i_, typename T)
1.220 + >
1.221 +struct apply
1.222 + : BOOST_PP_CAT(apply,i_)< F AUX778076_APPLY_N_COMMA_PARAMS(i_, T) >
1.223 +{
1.224 +};
1.225 +#else
1.226 +template<
1.227 + typename F AUX778076_APPLY_N_COMMA_PARAMS(i_, typename T)
1.228 + >
1.229 +struct apply< F AUX778076_APPLY_N_PARTIAL_SPEC_PARAMS(i_, T, na) >
1.230 + : BOOST_PP_CAT(apply,i_)< F AUX778076_APPLY_N_COMMA_PARAMS(i_, T) >
1.231 +{
1.232 +};
1.233 +#endif
1.234 +
1.235 +# else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
1.236 +
1.237 +#if !defined(BOOST_MPL_CFG_NO_APPLY_TEMPLATE)
1.238 +namespace aux {
1.239 +
1.240 +template<>
1.241 +struct apply_chooser<i_>
1.242 +{
1.243 + template<
1.244 + typename F, AUX778076_APPLY_PARAMS(typename T)
1.245 + >
1.246 + struct result_
1.247 + {
1.248 + typedef BOOST_PP_CAT(apply,i_)<
1.249 + F AUX778076_APPLY_N_COMMA_PARAMS(i_, T)
1.250 + > type;
1.251 + };
1.252 +};
1.253 +
1.254 +} // namespace aux
1.255 +#endif
1.256 +
1.257 +# endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
1.258 +# endif // BOOST_MPL_CFG_NO_APPLY_TEMPLATE
1.259 +
1.260 +# undef i_
1.261 +
1.262 +#endif // BOOST_PP_IS_ITERATING