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