mirror of
https://github.com/fortressforever/fortressforever-2013.git
synced 2025-02-15 08:32:15 +00:00
(part 2 oops..) fix for boost on gcc, #elif works differently (more correct) and breaks boost http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36453
the two .sh files got windows newlines, so fix those too while we're here note: should use an awk script for "#elif BOOST_PP" -> "#else if BOOST_PP" transform .. Conflicts: mp/src/thirdparty/boost/functional/overloaded_function.hpp mp/src/thirdparty/boost/functional/overloaded_function/detail/base.hpp mp/src/thirdparty/boost/local_function/aux_/function.hpp mp/src/thirdparty/boost/mpl/apply_wrap.hpp mp/src/thirdparty/boost/mpl/aux_/advance_backward.hpp mp/src/thirdparty/boost/mpl/aux_/advance_forward.hpp mp/src/thirdparty/boost/mpl/bind.hpp mp/src/thirdparty/boost/numeric/conversion/detail/numeric_cast_traits.hpp mp/src/thirdparty/boost/spirit/home/phoenix/statement/detail/catch_all_eval.hpp mp/src/thirdparty/boost/spirit/home/phoenix/statement/detail/catch_eval.hpp mp/src/thirdparty/boost/variant/detail/substitute.hpp
This commit is contained in:
parent
4babbaf7d8
commit
91b9020f9f
12 changed files with 2317 additions and 2317 deletions
|
@ -1,311 +1,311 @@
|
|||
|
||||
// Copyright (C) 2009-2012 Lorenzo Caminiti
|
||||
// Distributed under the Boost Software License, Version 1.0
|
||||
// (see accompanying file LICENSE_1_0.txt or a copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
// Home at http://www.boost.org/libs/functional/overloaded_function
|
||||
|
||||
#ifndef DOXYGEN // Doxygen documentation only.
|
||||
|
||||
#if !BOOST_PP_IS_ITERATING
|
||||
# ifndef BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_HPP_
|
||||
# define BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_HPP_
|
||||
|
||||
# include <boost/functional/overloaded_function/detail/base.hpp>
|
||||
# include <boost/functional/overloaded_function/detail/function_type.hpp>
|
||||
# include <boost/functional/overloaded_function/config.hpp>
|
||||
# include <boost/typeof/typeof.hpp>
|
||||
# include <boost/preprocessor/iteration/iterate.hpp>
|
||||
# include <boost/preprocessor/repetition/enum.hpp>
|
||||
# include <boost/preprocessor/repetition/repeat.hpp>
|
||||
# include <boost/preprocessor/control/expr_iif.hpp>
|
||||
# include <boost/preprocessor/control/expr_if.hpp>
|
||||
# include <boost/preprocessor/comparison/greater.hpp>
|
||||
# include <boost/preprocessor/comparison/less.hpp>
|
||||
# include <boost/preprocessor/cat.hpp>
|
||||
# include <boost/preprocessor/arithmetic/add.hpp>
|
||||
# include <boost/preprocessor/arithmetic/sub.hpp>
|
||||
# include <boost/preprocessor/tuple/eat.hpp>
|
||||
# include <boost/preprocessor/logical/and.hpp>
|
||||
# include <boost/preprocessor/logical/not.hpp>
|
||||
# include <boost/preprocessor/facilities/expand.hpp>
|
||||
|
||||
#define BOOST_FUNCTIONAL_f_type(z, n, unused) \
|
||||
BOOST_PP_CAT(F, n)
|
||||
|
||||
#define BOOST_FUNCTIONAL_f_arg(z, n, unused) \
|
||||
BOOST_PP_CAT(f, n)
|
||||
|
||||
#define BOOST_FUNCTIONAL_f_tparam(z, n, unused) \
|
||||
typename BOOST_FUNCTIONAL_f_type(z, n, ~) \
|
||||
|
||||
#define BOOST_FUNCTIONAL_f_tparam_dflt(z, n, is_tspec) \
|
||||
BOOST_FUNCTIONAL_f_tparam(z, n, ~) \
|
||||
/* overload requires at least 2 functors so F0 and F1 not optional */ \
|
||||
BOOST_PP_EXPR_IIF(BOOST_PP_AND(BOOST_PP_NOT(is_tspec), \
|
||||
BOOST_PP_GREATER(n, 1)), \
|
||||
= void \
|
||||
)
|
||||
|
||||
#define BOOST_FUNCTIONAL_f_arg_decl(z, n, unused) \
|
||||
BOOST_FUNCTIONAL_f_type(z, n, ~) /* no qualifier to deduce tparam */ \
|
||||
BOOST_FUNCTIONAL_f_arg(z, n, ~)
|
||||
|
||||
#define BOOST_FUNCTIONAL_g_type(z, n, unused) \
|
||||
BOOST_PP_CAT(G, n)
|
||||
|
||||
#define BOOST_FUNCTIONAL_g_arg(z, n, unused) \
|
||||
BOOST_PP_CAT(g, n)
|
||||
|
||||
#define BOOST_FUNCTIONAL_g_tparam(z, n, unused) \
|
||||
typename BOOST_FUNCTIONAL_g_type(z, n, ~)
|
||||
|
||||
#define BOOST_FUNCTIONAL_g_arg_decl(z, n, unused) \
|
||||
BOOST_FUNCTIONAL_g_type(z, n, ~) /* no qualifier to deduce tparam */ \
|
||||
BOOST_FUNCTIONAL_g_arg(z, n, ~)
|
||||
|
||||
#define BOOST_FUNCTIONAL_base(z, n, unused) \
|
||||
::boost::overloaded_function_detail::base< \
|
||||
BOOST_FUNCTIONAL_f_type(z, n, ~) \
|
||||
>
|
||||
|
||||
#define BOOST_FUNCTIONAL_inherit(z, n, unused) \
|
||||
public BOOST_FUNCTIONAL_base(z, n, ~)
|
||||
|
||||
#define BOOST_FUNCTIONAL_base_init(z, n, unused) \
|
||||
BOOST_FUNCTIONAL_base(z, n, ~)(BOOST_FUNCTIONAL_g_arg(z, n, ~))
|
||||
|
||||
#define BOOST_FUNCTIONAL_using_operator_call(z, n, unused) \
|
||||
using BOOST_FUNCTIONAL_base(z, n, ~)::operator();
|
||||
|
||||
#define BOOST_FUNCTIONAL_function_type(z, n, unused) \
|
||||
typename ::boost::overloaded_function_detail::function_type< \
|
||||
BOOST_FUNCTIONAL_f_type(z, n, ~) \
|
||||
>::type
|
||||
|
||||
# define BOOST_PP_ITERATION_PARAMS_1 \
|
||||
/* at least 2 func to overload so start from 2 to MAX */ \
|
||||
/* (cannot iterate [0, MAX-2) because error on Sun) */ \
|
||||
(3, (2, BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX, \
|
||||
"boost/functional/overloaded_function.hpp"))
|
||||
# include BOOST_PP_ITERATE() // Iterate over function arity.
|
||||
|
||||
#undef BOOST_FUNCTIONAL_f_type
|
||||
#undef BOOST_FUNCTIONAL_f_arg
|
||||
#undef BOOST_FUNCTIONAL_f_tparam
|
||||
#undef BOOST_FUNCTIONAL_f_arg_decl
|
||||
#undef BOOST_FUNCTIONAL_f_tparam_dflt
|
||||
#undef BOOST_FUNCTIONAL_g_type
|
||||
#undef BOOST_FUNCTIONAL_g_arg
|
||||
#undef BOOST_FUNCTIONAL_g_tparam
|
||||
#undef BOOST_FUNCTIONAL_g_arg_decl
|
||||
#undef BOOST_FUNCTIONAL_base
|
||||
#undef BOOST_FUNCTIONAL_inherit
|
||||
#undef BOOST_FUNCTIONAL_base_init
|
||||
#undef BOOST_FUNCTIONAL_using_operator_call
|
||||
#undef BOOST_FUNCTIONAL_function_type
|
||||
|
||||
# endif // #include guard
|
||||
|
||||
#elif BOOST_PP_ITERATION_DEPTH() == 1
|
||||
# define BOOST_FUNCTIONAL_overloads \
|
||||
/* iterate as OVERLOADS, OVERLOADS-1, OVERLOADS-2, ... */ \
|
||||
/* (add 2 because iteration started from 2 to MAX) */ \
|
||||
BOOST_PP_ADD(2, BOOST_PP_SUB( \
|
||||
BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX, \
|
||||
BOOST_PP_FRAME_ITERATION(1)))
|
||||
# define BOOST_FUNCTIONAL_is_tspec \
|
||||
/* if template specialization */ \
|
||||
BOOST_PP_LESS(BOOST_FUNCTIONAL_overloads, \
|
||||
BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX)
|
||||
|
||||
// For type-of emulation: This must be included at this pp iteration level.
|
||||
# include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
|
||||
|
||||
namespace boost {
|
||||
|
||||
template<
|
||||
BOOST_PP_ENUM(BOOST_FUNCTIONAL_overloads, BOOST_FUNCTIONAL_f_tparam_dflt,
|
||||
BOOST_FUNCTIONAL_is_tspec)
|
||||
>
|
||||
class overloaded_function
|
||||
// Template specialization.
|
||||
BOOST_PP_EXPR_IIF(BOOST_PP_EXPAND(BOOST_FUNCTIONAL_is_tspec), <)
|
||||
BOOST_PP_IIF(BOOST_FUNCTIONAL_is_tspec,
|
||||
BOOST_PP_ENUM
|
||||
,
|
||||
BOOST_PP_TUPLE_EAT(3)
|
||||
)(BOOST_FUNCTIONAL_overloads, BOOST_FUNCTIONAL_f_type, ~)
|
||||
BOOST_PP_EXPR_IIF(BOOST_PP_EXPAND(BOOST_FUNCTIONAL_is_tspec), >)
|
||||
// Bases (overloads >= 2 so always at least 2 bases).
|
||||
: BOOST_PP_ENUM(BOOST_FUNCTIONAL_overloads,
|
||||
BOOST_FUNCTIONAL_inherit, ~)
|
||||
{
|
||||
public:
|
||||
template<
|
||||
BOOST_PP_ENUM(BOOST_FUNCTIONAL_overloads, BOOST_FUNCTIONAL_g_tparam, ~)
|
||||
> /* implicit */ inline overloaded_function(
|
||||
BOOST_PP_ENUM(BOOST_FUNCTIONAL_overloads,
|
||||
BOOST_FUNCTIONAL_g_arg_decl, ~))
|
||||
// Overloads >= 2 so always at least 2 bases to initialize.
|
||||
: BOOST_PP_ENUM(BOOST_FUNCTIONAL_overloads,
|
||||
BOOST_FUNCTIONAL_base_init, ~)
|
||||
{}
|
||||
|
||||
BOOST_PP_REPEAT(BOOST_FUNCTIONAL_overloads,
|
||||
BOOST_FUNCTIONAL_using_operator_call, ~)
|
||||
};
|
||||
|
||||
template<
|
||||
BOOST_PP_ENUM(BOOST_FUNCTIONAL_overloads, BOOST_FUNCTIONAL_f_tparam, ~)
|
||||
>
|
||||
overloaded_function<
|
||||
BOOST_PP_ENUM(BOOST_FUNCTIONAL_overloads, BOOST_FUNCTIONAL_function_type, ~)
|
||||
> make_overloaded_function(
|
||||
BOOST_PP_ENUM(BOOST_FUNCTIONAL_overloads, BOOST_FUNCTIONAL_f_arg_decl, ~)
|
||||
) {
|
||||
return overloaded_function<
|
||||
BOOST_PP_ENUM(BOOST_FUNCTIONAL_overloads,
|
||||
BOOST_FUNCTIONAL_function_type, ~)
|
||||
>(BOOST_PP_ENUM(BOOST_FUNCTIONAL_overloads, BOOST_FUNCTIONAL_f_arg, ~));
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
// For type-of emulation: Register overloaded function type (for _AUTO, etc).
|
||||
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::overloaded_function,
|
||||
BOOST_FUNCTIONAL_overloads)
|
||||
|
||||
# undef BOOST_FUNCTIONAL_overloads
|
||||
# undef BOOST_FUNCTIONAL_is_tspec
|
||||
#endif // iteration
|
||||
|
||||
// DOCUMENTATION //
|
||||
|
||||
#else // DOXYGEN
|
||||
|
||||
/** @file
|
||||
@brief Overload distinct function pointers, function references, and
|
||||
monomorphic function objects into a single function object.
|
||||
*/
|
||||
|
||||
namespace boost {
|
||||
|
||||
/**
|
||||
@brief Function object to overload functions with distinct signatures.
|
||||
|
||||
This function object aggregates together calls to functions of all the
|
||||
specified function types <c>F1</c>, <c>F2</c>, etc which must have distinct
|
||||
function signatures from one another.
|
||||
|
||||
@Params
|
||||
@Param{F<em>i</em>,
|
||||
Each function type must be specified using the following syntax (which is
|
||||
Boost.Function's preferred syntax):
|
||||
@code
|
||||
result_type (argument1_type\, argumgnet2_type\, ...)
|
||||
@endcode
|
||||
}
|
||||
@EndParams
|
||||
|
||||
In some cases, the @RefFunc{make_overloaded_function} function template can be
|
||||
useful to construct an overloaded function object without explicitly
|
||||
specifying the function types.
|
||||
|
||||
At least two distinct function types must be specified (because there is
|
||||
nothing to overload between one or zero functions).
|
||||
The maximum number of functions to overload is given by the
|
||||
@RefMacro{BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX}
|
||||
configuration macro.
|
||||
The maximum number of function parameters for each of the specified function
|
||||
types is given by the
|
||||
@RefMacro{BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_ARITY_MAX}
|
||||
configuration macro.
|
||||
|
||||
@See @RefSect{tutorial, Tutorial} section, @RefFunc{make_overloaded_function},
|
||||
@RefMacro{BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX},
|
||||
@RefMacro{BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_ARITY_MAX},
|
||||
Boost.Function.
|
||||
*/
|
||||
template<typename F1, typename F2, ...>
|
||||
class overloaded_function {
|
||||
public:
|
||||
/**
|
||||
@brief Construct the overloaded function object.
|
||||
|
||||
Any function pointer, function reference, and monomorphic function object
|
||||
that can be converted to a <c>boost::function</c> function object can be
|
||||
specified as parameter.
|
||||
|
||||
@Note Unfortunately, it is not possible to support polymorphic function
|
||||
objects (as explained <a
|
||||
href="http://lists.boost.org/Archives/boost/2012/03/191744.php">here</a>).
|
||||
*/
|
||||
overloaded_function(const boost::function<F1>&,
|
||||
const boost::function<F2>&, ...);
|
||||
|
||||
/**
|
||||
@brief Call operator matching the signature of the function type specified
|
||||
as 1st template parameter.
|
||||
|
||||
This will in turn invoke the call operator of the 1st function passed to
|
||||
the constructor.
|
||||
*/
|
||||
typename boost::function_traits<F1>::result_type operator()(
|
||||
typename boost::function_traits<F1>::arg1_type,
|
||||
typename boost::function_traits<F1>::arg2_type,
|
||||
...) const;
|
||||
|
||||
/**
|
||||
@brief Call operator matching the signature of the function type specified
|
||||
as 2nd template parameter.
|
||||
|
||||
This will in turn invoke the call operator of the 2nd function passed to
|
||||
the constructor.
|
||||
|
||||
@Note Similar call operators are present for all specified function types
|
||||
<c>F1</c>, <c>F2</c>, etc (even if not exhaustively listed by this
|
||||
documentation).
|
||||
*/
|
||||
typename boost::function_traits<F2>::result_type operator()(
|
||||
typename boost::function_traits<F2>::arg1_type,
|
||||
typename boost::function_traits<F2>::arg2_type,
|
||||
...) const;
|
||||
};
|
||||
|
||||
/**
|
||||
@brief Make an overloaded function object without explicitly specifying the
|
||||
function types.
|
||||
|
||||
This function template creates and returns an @RefClass{overloaded_function}
|
||||
object that overloads all the specified functions <c>f1</c>, <c>f2</c>, etc.
|
||||
|
||||
The function types are internally determined from the template parameter types
|
||||
so they do not need to be explicitly specified.
|
||||
Therefore, this function template usually has a more concise syntax when
|
||||
compared with @RefClass{overloaded_function}.
|
||||
This is especially useful when the explicit type of the returned
|
||||
@RefClass{overloaded_function} object does not need to be known (e.g., when
|
||||
used with Boost.Typeof's <c>BOOST_AUTO</c>, C++11 <c>auto</c>, or when the
|
||||
overloaded function object is handled using a function template parameter, see
|
||||
the @RefSect{tutorial, Tutorial} section).
|
||||
|
||||
The maximum number of functions to overload is given by the
|
||||
@RefMacro{BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX}
|
||||
configuration macro.
|
||||
|
||||
@Note In this documentation, <c>__function_type__</c> is a placeholder for a
|
||||
symbol that is specific to the implementation of this library.
|
||||
|
||||
@See @RefSect{tutorial, Tutorial} section, @RefClass{overloaded_function},
|
||||
@RefMacro{BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX}.
|
||||
*/
|
||||
template<typename F1, typename F2, ...>
|
||||
overloaded_function<
|
||||
__function_type__<F1>, __function_type__<F2>, ...
|
||||
> make_overloaded_function(F1 f1, F2 f2, ...);
|
||||
|
||||
} // namespace
|
||||
|
||||
#endif // DOXYGEN
|
||||
|
||||
|
||||
// Copyright (C) 2009-2012 Lorenzo Caminiti
|
||||
// Distributed under the Boost Software License, Version 1.0
|
||||
// (see accompanying file LICENSE_1_0.txt or a copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
// Home at http://www.boost.org/libs/functional/overloaded_function
|
||||
|
||||
#ifndef DOXYGEN // Doxygen documentation only.
|
||||
|
||||
#if !BOOST_PP_IS_ITERATING
|
||||
# ifndef BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_HPP_
|
||||
# define BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_HPP_
|
||||
|
||||
# include <boost/functional/overloaded_function/detail/base.hpp>
|
||||
# include <boost/functional/overloaded_function/detail/function_type.hpp>
|
||||
# include <boost/functional/overloaded_function/config.hpp>
|
||||
# include <boost/typeof/typeof.hpp>
|
||||
# include <boost/preprocessor/iteration/iterate.hpp>
|
||||
# include <boost/preprocessor/repetition/enum.hpp>
|
||||
# include <boost/preprocessor/repetition/repeat.hpp>
|
||||
# include <boost/preprocessor/control/expr_iif.hpp>
|
||||
# include <boost/preprocessor/control/expr_if.hpp>
|
||||
# include <boost/preprocessor/comparison/greater.hpp>
|
||||
# include <boost/preprocessor/comparison/less.hpp>
|
||||
# include <boost/preprocessor/cat.hpp>
|
||||
# include <boost/preprocessor/arithmetic/add.hpp>
|
||||
# include <boost/preprocessor/arithmetic/sub.hpp>
|
||||
# include <boost/preprocessor/tuple/eat.hpp>
|
||||
# include <boost/preprocessor/logical/and.hpp>
|
||||
# include <boost/preprocessor/logical/not.hpp>
|
||||
# include <boost/preprocessor/facilities/expand.hpp>
|
||||
|
||||
#define BOOST_FUNCTIONAL_f_type(z, n, unused) \
|
||||
BOOST_PP_CAT(F, n)
|
||||
|
||||
#define BOOST_FUNCTIONAL_f_arg(z, n, unused) \
|
||||
BOOST_PP_CAT(f, n)
|
||||
|
||||
#define BOOST_FUNCTIONAL_f_tparam(z, n, unused) \
|
||||
typename BOOST_FUNCTIONAL_f_type(z, n, ~) \
|
||||
|
||||
#define BOOST_FUNCTIONAL_f_tparam_dflt(z, n, is_tspec) \
|
||||
BOOST_FUNCTIONAL_f_tparam(z, n, ~) \
|
||||
/* overload requires at least 2 functors so F0 and F1 not optional */ \
|
||||
BOOST_PP_EXPR_IIF(BOOST_PP_AND(BOOST_PP_NOT(is_tspec), \
|
||||
BOOST_PP_GREATER(n, 1)), \
|
||||
= void \
|
||||
)
|
||||
|
||||
#define BOOST_FUNCTIONAL_f_arg_decl(z, n, unused) \
|
||||
BOOST_FUNCTIONAL_f_type(z, n, ~) /* no qualifier to deduce tparam */ \
|
||||
BOOST_FUNCTIONAL_f_arg(z, n, ~)
|
||||
|
||||
#define BOOST_FUNCTIONAL_g_type(z, n, unused) \
|
||||
BOOST_PP_CAT(G, n)
|
||||
|
||||
#define BOOST_FUNCTIONAL_g_arg(z, n, unused) \
|
||||
BOOST_PP_CAT(g, n)
|
||||
|
||||
#define BOOST_FUNCTIONAL_g_tparam(z, n, unused) \
|
||||
typename BOOST_FUNCTIONAL_g_type(z, n, ~)
|
||||
|
||||
#define BOOST_FUNCTIONAL_g_arg_decl(z, n, unused) \
|
||||
BOOST_FUNCTIONAL_g_type(z, n, ~) /* no qualifier to deduce tparam */ \
|
||||
BOOST_FUNCTIONAL_g_arg(z, n, ~)
|
||||
|
||||
#define BOOST_FUNCTIONAL_base(z, n, unused) \
|
||||
::boost::overloaded_function_detail::base< \
|
||||
BOOST_FUNCTIONAL_f_type(z, n, ~) \
|
||||
>
|
||||
|
||||
#define BOOST_FUNCTIONAL_inherit(z, n, unused) \
|
||||
public BOOST_FUNCTIONAL_base(z, n, ~)
|
||||
|
||||
#define BOOST_FUNCTIONAL_base_init(z, n, unused) \
|
||||
BOOST_FUNCTIONAL_base(z, n, ~)(BOOST_FUNCTIONAL_g_arg(z, n, ~))
|
||||
|
||||
#define BOOST_FUNCTIONAL_using_operator_call(z, n, unused) \
|
||||
using BOOST_FUNCTIONAL_base(z, n, ~)::operator();
|
||||
|
||||
#define BOOST_FUNCTIONAL_function_type(z, n, unused) \
|
||||
typename ::boost::overloaded_function_detail::function_type< \
|
||||
BOOST_FUNCTIONAL_f_type(z, n, ~) \
|
||||
>::type
|
||||
|
||||
# define BOOST_PP_ITERATION_PARAMS_1 \
|
||||
/* at least 2 func to overload so start from 2 to MAX */ \
|
||||
/* (cannot iterate [0, MAX-2) because error on Sun) */ \
|
||||
(3, (2, BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX, \
|
||||
"boost/functional/overloaded_function.hpp"))
|
||||
# include BOOST_PP_ITERATE() // Iterate over function arity.
|
||||
|
||||
#undef BOOST_FUNCTIONAL_f_type
|
||||
#undef BOOST_FUNCTIONAL_f_arg
|
||||
#undef BOOST_FUNCTIONAL_f_tparam
|
||||
#undef BOOST_FUNCTIONAL_f_arg_decl
|
||||
#undef BOOST_FUNCTIONAL_f_tparam_dflt
|
||||
#undef BOOST_FUNCTIONAL_g_type
|
||||
#undef BOOST_FUNCTIONAL_g_arg
|
||||
#undef BOOST_FUNCTIONAL_g_tparam
|
||||
#undef BOOST_FUNCTIONAL_g_arg_decl
|
||||
#undef BOOST_FUNCTIONAL_base
|
||||
#undef BOOST_FUNCTIONAL_inherit
|
||||
#undef BOOST_FUNCTIONAL_base_init
|
||||
#undef BOOST_FUNCTIONAL_using_operator_call
|
||||
#undef BOOST_FUNCTIONAL_function_type
|
||||
|
||||
# endif // #include guard
|
||||
|
||||
#else if BOOST_PP_ITERATION_DEPTH() == 1
|
||||
# define BOOST_FUNCTIONAL_overloads \
|
||||
/* iterate as OVERLOADS, OVERLOADS-1, OVERLOADS-2, ... */ \
|
||||
/* (add 2 because iteration started from 2 to MAX) */ \
|
||||
BOOST_PP_ADD(2, BOOST_PP_SUB( \
|
||||
BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX, \
|
||||
BOOST_PP_FRAME_ITERATION(1)))
|
||||
# define BOOST_FUNCTIONAL_is_tspec \
|
||||
/* if template specialization */ \
|
||||
BOOST_PP_LESS(BOOST_FUNCTIONAL_overloads, \
|
||||
BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX)
|
||||
|
||||
// For type-of emulation: This must be included at this pp iteration level.
|
||||
# include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
|
||||
|
||||
namespace boost {
|
||||
|
||||
template<
|
||||
BOOST_PP_ENUM(BOOST_FUNCTIONAL_overloads, BOOST_FUNCTIONAL_f_tparam_dflt,
|
||||
BOOST_FUNCTIONAL_is_tspec)
|
||||
>
|
||||
class overloaded_function
|
||||
// Template specialization.
|
||||
BOOST_PP_EXPR_IIF(BOOST_PP_EXPAND(BOOST_FUNCTIONAL_is_tspec), <)
|
||||
BOOST_PP_IIF(BOOST_FUNCTIONAL_is_tspec,
|
||||
BOOST_PP_ENUM
|
||||
,
|
||||
BOOST_PP_TUPLE_EAT(3)
|
||||
)(BOOST_FUNCTIONAL_overloads, BOOST_FUNCTIONAL_f_type, ~)
|
||||
BOOST_PP_EXPR_IIF(BOOST_PP_EXPAND(BOOST_FUNCTIONAL_is_tspec), >)
|
||||
// Bases (overloads >= 2 so always at least 2 bases).
|
||||
: BOOST_PP_ENUM(BOOST_FUNCTIONAL_overloads,
|
||||
BOOST_FUNCTIONAL_inherit, ~)
|
||||
{
|
||||
public:
|
||||
template<
|
||||
BOOST_PP_ENUM(BOOST_FUNCTIONAL_overloads, BOOST_FUNCTIONAL_g_tparam, ~)
|
||||
> /* implicit */ inline overloaded_function(
|
||||
BOOST_PP_ENUM(BOOST_FUNCTIONAL_overloads,
|
||||
BOOST_FUNCTIONAL_g_arg_decl, ~))
|
||||
// Overloads >= 2 so always at least 2 bases to initialize.
|
||||
: BOOST_PP_ENUM(BOOST_FUNCTIONAL_overloads,
|
||||
BOOST_FUNCTIONAL_base_init, ~)
|
||||
{}
|
||||
|
||||
BOOST_PP_REPEAT(BOOST_FUNCTIONAL_overloads,
|
||||
BOOST_FUNCTIONAL_using_operator_call, ~)
|
||||
};
|
||||
|
||||
template<
|
||||
BOOST_PP_ENUM(BOOST_FUNCTIONAL_overloads, BOOST_FUNCTIONAL_f_tparam, ~)
|
||||
>
|
||||
overloaded_function<
|
||||
BOOST_PP_ENUM(BOOST_FUNCTIONAL_overloads, BOOST_FUNCTIONAL_function_type, ~)
|
||||
> make_overloaded_function(
|
||||
BOOST_PP_ENUM(BOOST_FUNCTIONAL_overloads, BOOST_FUNCTIONAL_f_arg_decl, ~)
|
||||
) {
|
||||
return overloaded_function<
|
||||
BOOST_PP_ENUM(BOOST_FUNCTIONAL_overloads,
|
||||
BOOST_FUNCTIONAL_function_type, ~)
|
||||
>(BOOST_PP_ENUM(BOOST_FUNCTIONAL_overloads, BOOST_FUNCTIONAL_f_arg, ~));
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
// For type-of emulation: Register overloaded function type (for _AUTO, etc).
|
||||
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::overloaded_function,
|
||||
BOOST_FUNCTIONAL_overloads)
|
||||
|
||||
# undef BOOST_FUNCTIONAL_overloads
|
||||
# undef BOOST_FUNCTIONAL_is_tspec
|
||||
#endif // iteration
|
||||
|
||||
// DOCUMENTATION //
|
||||
|
||||
#else // DOXYGEN
|
||||
|
||||
/** @file
|
||||
@brief Overload distinct function pointers, function references, and
|
||||
monomorphic function objects into a single function object.
|
||||
*/
|
||||
|
||||
namespace boost {
|
||||
|
||||
/**
|
||||
@brief Function object to overload functions with distinct signatures.
|
||||
|
||||
This function object aggregates together calls to functions of all the
|
||||
specified function types <c>F1</c>, <c>F2</c>, etc which must have distinct
|
||||
function signatures from one another.
|
||||
|
||||
@Params
|
||||
@Param{F<em>i</em>,
|
||||
Each function type must be specified using the following syntax (which is
|
||||
Boost.Function's preferred syntax):
|
||||
@code
|
||||
result_type (argument1_type\, argumgnet2_type\, ...)
|
||||
@endcode
|
||||
}
|
||||
@EndParams
|
||||
|
||||
In some cases, the @RefFunc{make_overloaded_function} function template can be
|
||||
useful to construct an overloaded function object without explicitly
|
||||
specifying the function types.
|
||||
|
||||
At least two distinct function types must be specified (because there is
|
||||
nothing to overload between one or zero functions).
|
||||
The maximum number of functions to overload is given by the
|
||||
@RefMacro{BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX}
|
||||
configuration macro.
|
||||
The maximum number of function parameters for each of the specified function
|
||||
types is given by the
|
||||
@RefMacro{BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_ARITY_MAX}
|
||||
configuration macro.
|
||||
|
||||
@See @RefSect{tutorial, Tutorial} section, @RefFunc{make_overloaded_function},
|
||||
@RefMacro{BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX},
|
||||
@RefMacro{BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_ARITY_MAX},
|
||||
Boost.Function.
|
||||
*/
|
||||
template<typename F1, typename F2, ...>
|
||||
class overloaded_function {
|
||||
public:
|
||||
/**
|
||||
@brief Construct the overloaded function object.
|
||||
|
||||
Any function pointer, function reference, and monomorphic function object
|
||||
that can be converted to a <c>boost::function</c> function object can be
|
||||
specified as parameter.
|
||||
|
||||
@Note Unfortunately, it is not possible to support polymorphic function
|
||||
objects (as explained <a
|
||||
href="http://lists.boost.org/Archives/boost/2012/03/191744.php">here</a>).
|
||||
*/
|
||||
overloaded_function(const boost::function<F1>&,
|
||||
const boost::function<F2>&, ...);
|
||||
|
||||
/**
|
||||
@brief Call operator matching the signature of the function type specified
|
||||
as 1st template parameter.
|
||||
|
||||
This will in turn invoke the call operator of the 1st function passed to
|
||||
the constructor.
|
||||
*/
|
||||
typename boost::function_traits<F1>::result_type operator()(
|
||||
typename boost::function_traits<F1>::arg1_type,
|
||||
typename boost::function_traits<F1>::arg2_type,
|
||||
...) const;
|
||||
|
||||
/**
|
||||
@brief Call operator matching the signature of the function type specified
|
||||
as 2nd template parameter.
|
||||
|
||||
This will in turn invoke the call operator of the 2nd function passed to
|
||||
the constructor.
|
||||
|
||||
@Note Similar call operators are present for all specified function types
|
||||
<c>F1</c>, <c>F2</c>, etc (even if not exhaustively listed by this
|
||||
documentation).
|
||||
*/
|
||||
typename boost::function_traits<F2>::result_type operator()(
|
||||
typename boost::function_traits<F2>::arg1_type,
|
||||
typename boost::function_traits<F2>::arg2_type,
|
||||
...) const;
|
||||
};
|
||||
|
||||
/**
|
||||
@brief Make an overloaded function object without explicitly specifying the
|
||||
function types.
|
||||
|
||||
This function template creates and returns an @RefClass{overloaded_function}
|
||||
object that overloads all the specified functions <c>f1</c>, <c>f2</c>, etc.
|
||||
|
||||
The function types are internally determined from the template parameter types
|
||||
so they do not need to be explicitly specified.
|
||||
Therefore, this function template usually has a more concise syntax when
|
||||
compared with @RefClass{overloaded_function}.
|
||||
This is especially useful when the explicit type of the returned
|
||||
@RefClass{overloaded_function} object does not need to be known (e.g., when
|
||||
used with Boost.Typeof's <c>BOOST_AUTO</c>, C++11 <c>auto</c>, or when the
|
||||
overloaded function object is handled using a function template parameter, see
|
||||
the @RefSect{tutorial, Tutorial} section).
|
||||
|
||||
The maximum number of functions to overload is given by the
|
||||
@RefMacro{BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX}
|
||||
configuration macro.
|
||||
|
||||
@Note In this documentation, <c>__function_type__</c> is a placeholder for a
|
||||
symbol that is specific to the implementation of this library.
|
||||
|
||||
@See @RefSect{tutorial, Tutorial} section, @RefClass{overloaded_function},
|
||||
@RefMacro{BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX}.
|
||||
*/
|
||||
template<typename F1, typename F2, ...>
|
||||
overloaded_function<
|
||||
__function_type__<F1>, __function_type__<F2>, ...
|
||||
> make_overloaded_function(F1 f1, F2 f2, ...);
|
||||
|
||||
} // namespace
|
||||
|
||||
#endif // DOXYGEN
|
||||
|
||||
|
|
|
@ -1,86 +1,86 @@
|
|||
|
||||
// Copyright (C) 2009-2012 Lorenzo Caminiti
|
||||
// Distributed under the Boost Software License, Version 1.0
|
||||
// (see accompanying file LICENSE_1_0.txt or a copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
// Home at http://www.boost.org/libs/functional/overloaded_function
|
||||
|
||||
#if !BOOST_PP_IS_ITERATING
|
||||
# ifndef BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_DETAIL_BASE_HPP_
|
||||
# define BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_DETAIL_BASE_HPP_
|
||||
|
||||
# include <boost/functional/overloaded_function/config.hpp>
|
||||
# include <boost/function.hpp>
|
||||
# include <boost/preprocessor/iteration/iterate.hpp>
|
||||
# include <boost/preprocessor/repetition/enum.hpp>
|
||||
# include <boost/preprocessor/cat.hpp>
|
||||
# include <boost/preprocessor/comma_if.hpp>
|
||||
|
||||
#define BOOST_FUNCTIONAL_DETAIL_arg_type(z, n, unused) \
|
||||
BOOST_PP_CAT(A, n)
|
||||
|
||||
#define BOOST_FUNCTIONAL_DETAIL_arg_name(z, n, unused) \
|
||||
BOOST_PP_CAT(a, n)
|
||||
|
||||
#define BOOST_FUNCTIONAL_DETAIL_arg_tparam(z, n, unused) \
|
||||
typename BOOST_FUNCTIONAL_DETAIL_arg_type(z, n, unused)
|
||||
|
||||
#define BOOST_FUNCTIONAL_DETAIL_arg(z, n, unused) \
|
||||
BOOST_FUNCTIONAL_DETAIL_arg_type(z, n, unused) \
|
||||
BOOST_FUNCTIONAL_DETAIL_arg_name(z, n, unused)
|
||||
|
||||
#define BOOST_FUNCTIONAL_DETAIL_f \
|
||||
R (BOOST_PP_ENUM(BOOST_FUNCTIONAL_DETAIL_arity, \
|
||||
BOOST_FUNCTIONAL_DETAIL_arg_type, ~))
|
||||
|
||||
// Do not use namespace ::detail because overloaded_function is already a class.
|
||||
namespace boost { namespace overloaded_function_detail {
|
||||
|
||||
template<typename F>
|
||||
class base {}; // Empty template cannot be used directly (only its spec).
|
||||
|
||||
# define BOOST_PP_ITERATION_PARAMS_1 \
|
||||
(3, (0, BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_ARITY_MAX, \
|
||||
"boost/functional/overloaded_function/detail/base.hpp"))
|
||||
# include BOOST_PP_ITERATE() // Iterate over funciton arity.
|
||||
|
||||
} } // namespace
|
||||
|
||||
#undef BOOST_FUNCTIONAL_DETAIL_arg_type
|
||||
#undef BOOST_FUNCTIONAL_DETAIL_arg_name
|
||||
#undef BOOST_FUNCTIONAL_DETAIL_arg_tparam
|
||||
#undef BOOST_FUNCTIONAL_DETAIL_arg
|
||||
#undef BOOST_FUNCTIONAL_DETAIL_f
|
||||
|
||||
# endif // #include guard
|
||||
|
||||
#elif BOOST_PP_ITERATION_DEPTH() == 1
|
||||
# define BOOST_FUNCTIONAL_DETAIL_arity BOOST_PP_FRAME_ITERATION(1)
|
||||
|
||||
template<
|
||||
typename R
|
||||
BOOST_PP_COMMA_IF(BOOST_FUNCTIONAL_DETAIL_arity)
|
||||
BOOST_PP_ENUM(BOOST_FUNCTIONAL_DETAIL_arity,
|
||||
BOOST_FUNCTIONAL_DETAIL_arg_tparam, ~)
|
||||
>
|
||||
class base< BOOST_FUNCTIONAL_DETAIL_f > {
|
||||
public:
|
||||
/* implicit */ inline base(
|
||||
// This requires specified type to be implicitly convertible to
|
||||
// a boost::function<> functor.
|
||||
boost::function< BOOST_FUNCTIONAL_DETAIL_f > const& f): f_(f)
|
||||
{}
|
||||
|
||||
inline R operator()(BOOST_PP_ENUM(BOOST_FUNCTIONAL_DETAIL_arity,
|
||||
BOOST_FUNCTIONAL_DETAIL_arg, ~)) const {
|
||||
return f_(BOOST_PP_ENUM(BOOST_FUNCTIONAL_DETAIL_arity,
|
||||
BOOST_FUNCTIONAL_DETAIL_arg_name, ~));
|
||||
}
|
||||
|
||||
private:
|
||||
boost::function< BOOST_FUNCTIONAL_DETAIL_f > const f_;
|
||||
};
|
||||
|
||||
# undef BOOST_FUNCTIONAL_DETAIL_arity
|
||||
#endif // iteration
|
||||
|
||||
|
||||
// Copyright (C) 2009-2012 Lorenzo Caminiti
|
||||
// Distributed under the Boost Software License, Version 1.0
|
||||
// (see accompanying file LICENSE_1_0.txt or a copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
// Home at http://www.boost.org/libs/functional/overloaded_function
|
||||
|
||||
#if !BOOST_PP_IS_ITERATING
|
||||
# ifndef BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_DETAIL_BASE_HPP_
|
||||
# define BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_DETAIL_BASE_HPP_
|
||||
|
||||
# include <boost/functional/overloaded_function/config.hpp>
|
||||
# include <boost/function.hpp>
|
||||
# include <boost/preprocessor/iteration/iterate.hpp>
|
||||
# include <boost/preprocessor/repetition/enum.hpp>
|
||||
# include <boost/preprocessor/cat.hpp>
|
||||
# include <boost/preprocessor/comma_if.hpp>
|
||||
|
||||
#define BOOST_FUNCTIONAL_DETAIL_arg_type(z, n, unused) \
|
||||
BOOST_PP_CAT(A, n)
|
||||
|
||||
#define BOOST_FUNCTIONAL_DETAIL_arg_name(z, n, unused) \
|
||||
BOOST_PP_CAT(a, n)
|
||||
|
||||
#define BOOST_FUNCTIONAL_DETAIL_arg_tparam(z, n, unused) \
|
||||
typename BOOST_FUNCTIONAL_DETAIL_arg_type(z, n, unused)
|
||||
|
||||
#define BOOST_FUNCTIONAL_DETAIL_arg(z, n, unused) \
|
||||
BOOST_FUNCTIONAL_DETAIL_arg_type(z, n, unused) \
|
||||
BOOST_FUNCTIONAL_DETAIL_arg_name(z, n, unused)
|
||||
|
||||
#define BOOST_FUNCTIONAL_DETAIL_f \
|
||||
R (BOOST_PP_ENUM(BOOST_FUNCTIONAL_DETAIL_arity, \
|
||||
BOOST_FUNCTIONAL_DETAIL_arg_type, ~))
|
||||
|
||||
// Do not use namespace ::detail because overloaded_function is already a class.
|
||||
namespace boost { namespace overloaded_function_detail {
|
||||
|
||||
template<typename F>
|
||||
class base {}; // Empty template cannot be used directly (only its spec).
|
||||
|
||||
# define BOOST_PP_ITERATION_PARAMS_1 \
|
||||
(3, (0, BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_ARITY_MAX, \
|
||||
"boost/functional/overloaded_function/detail/base.hpp"))
|
||||
# include BOOST_PP_ITERATE() // Iterate over funciton arity.
|
||||
|
||||
} } // namespace
|
||||
|
||||
#undef BOOST_FUNCTIONAL_DETAIL_arg_type
|
||||
#undef BOOST_FUNCTIONAL_DETAIL_arg_name
|
||||
#undef BOOST_FUNCTIONAL_DETAIL_arg_tparam
|
||||
#undef BOOST_FUNCTIONAL_DETAIL_arg
|
||||
#undef BOOST_FUNCTIONAL_DETAIL_f
|
||||
|
||||
# endif // #include guard
|
||||
|
||||
#else if BOOST_PP_ITERATION_DEPTH() == 1
|
||||
# define BOOST_FUNCTIONAL_DETAIL_arity BOOST_PP_FRAME_ITERATION(1)
|
||||
|
||||
template<
|
||||
typename R
|
||||
BOOST_PP_COMMA_IF(BOOST_FUNCTIONAL_DETAIL_arity)
|
||||
BOOST_PP_ENUM(BOOST_FUNCTIONAL_DETAIL_arity,
|
||||
BOOST_FUNCTIONAL_DETAIL_arg_tparam, ~)
|
||||
>
|
||||
class base< BOOST_FUNCTIONAL_DETAIL_f > {
|
||||
public:
|
||||
/* implicit */ inline base(
|
||||
// This requires specified type to be implicitly convertible to
|
||||
// a boost::function<> functor.
|
||||
boost::function< BOOST_FUNCTIONAL_DETAIL_f > const& f): f_(f)
|
||||
{}
|
||||
|
||||
inline R operator()(BOOST_PP_ENUM(BOOST_FUNCTIONAL_DETAIL_arity,
|
||||
BOOST_FUNCTIONAL_DETAIL_arg, ~)) const {
|
||||
return f_(BOOST_PP_ENUM(BOOST_FUNCTIONAL_DETAIL_arity,
|
||||
BOOST_FUNCTIONAL_DETAIL_arg_name, ~));
|
||||
}
|
||||
|
||||
private:
|
||||
boost::function< BOOST_FUNCTIONAL_DETAIL_f > const f_;
|
||||
};
|
||||
|
||||
# undef BOOST_FUNCTIONAL_DETAIL_arity
|
||||
#endif // iteration
|
||||
|
||||
|
|
|
@ -1,330 +1,330 @@
|
|||
|
||||
// Copyright (C) 2009-2012 Lorenzo Caminiti
|
||||
// Distributed under the Boost Software License, Version 1.0
|
||||
// (see accompanying file LICENSE_1_0.txt or a copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
// Home at http://www.boost.org/libs/local_function
|
||||
|
||||
#if !BOOST_PP_IS_ITERATING
|
||||
# ifndef BOOST_LOCAL_FUNCTION_AUX_FUNCTION_HPP_
|
||||
# define BOOST_LOCAL_FUNCTION_AUX_FUNCTION_HPP_
|
||||
|
||||
# include <boost/local_function/config.hpp>
|
||||
# include <boost/local_function/aux_/member.hpp>
|
||||
# include <boost/call_traits.hpp>
|
||||
# include <boost/typeof/typeof.hpp>
|
||||
# include <boost/config.hpp>
|
||||
# include <boost/preprocessor/iteration/iterate.hpp>
|
||||
# include <boost/preprocessor/repetition/repeat.hpp>
|
||||
# include <boost/preprocessor/repetition/enum.hpp>
|
||||
# include <boost/preprocessor/punctuation/comma_if.hpp>
|
||||
# include <boost/preprocessor/arithmetic/add.hpp>
|
||||
# include <boost/preprocessor/arithmetic/sub.hpp>
|
||||
# include <boost/preprocessor/arithmetic/inc.hpp>
|
||||
# include <boost/preprocessor/control/iif.hpp>
|
||||
# include <boost/preprocessor/cat.hpp>
|
||||
|
||||
// PRIVATE //
|
||||
|
||||
#define BOOST_LOCAL_FUNCTION_AUX_FUNCTION_THIS_FILE_ \
|
||||
"boost/local_function/aux_/function.hpp"
|
||||
|
||||
// PUBLIC //
|
||||
|
||||
#define BOOST_LOCAL_FUNCTION_AUX_FUNCTION_INIT_CALL_FUNC \
|
||||
BOOST_LOCAL_FUNCTION_AUX_SYMBOL( (init_call) )
|
||||
|
||||
#define BOOST_LOCAL_FUNCTION_AUX_typename_seq(z, n, unused) \
|
||||
(typename)
|
||||
|
||||
#define BOOST_LOCAL_FUNCTION_AUX_arg_type(z, arg_n, unused) \
|
||||
BOOST_PP_CAT(Arg, arg_n)
|
||||
|
||||
#define BOOST_LOCAL_FUNCTION_AUX_arg_typedef(z, arg_n, unused) \
|
||||
typedef \
|
||||
BOOST_LOCAL_FUNCTION_AUX_arg_type(z, arg_n, ~) \
|
||||
/* name must follow Boost.FunctionTraits arg1_type, arg2_type, ... */ \
|
||||
BOOST_PP_CAT(BOOST_PP_CAT(arg, BOOST_PP_INC(arg_n)), _type) \
|
||||
;
|
||||
|
||||
#define BOOST_LOCAL_FUNCTION_AUX_comma_arg_tparam(z, arg_n, unused) \
|
||||
, typename BOOST_LOCAL_FUNCTION_AUX_arg_type(z, arg_n, ~)
|
||||
|
||||
#define BOOST_LOCAL_FUNCTION_AUX_arg_param_type(z, arg_n, comma01) \
|
||||
BOOST_PP_COMMA_IF(comma01) \
|
||||
typename ::boost::call_traits< \
|
||||
BOOST_LOCAL_FUNCTION_AUX_arg_type(z, arg_n, ~) \
|
||||
>::param_type
|
||||
|
||||
#define BOOST_LOCAL_FUNCTION_AUX_arg_name(z, arg_n, comma01) \
|
||||
BOOST_PP_COMMA_IF(comma01) \
|
||||
BOOST_PP_CAT(arg, arg_n)
|
||||
|
||||
#define BOOST_LOCAL_FUNCTION_AUX_arg_param_decl(z, arg_n, unused) \
|
||||
BOOST_LOCAL_FUNCTION_AUX_arg_param_type(z, arg_n, 0 /* no leading comma */)\
|
||||
BOOST_LOCAL_FUNCTION_AUX_arg_name(z, arg_n, 0 /* no leading comma */)
|
||||
|
||||
#define BOOST_LOCAL_FUNCTION_AUX_bind_type(z, bind_n, unused) \
|
||||
BOOST_PP_CAT(Bind, bind_n)
|
||||
|
||||
#define BOOST_LOCAL_FUNCTION_AUX_comma_bind_type(z, bind_n, unused) \
|
||||
, BOOST_LOCAL_FUNCTION_AUX_bind_type(z, bind_n, ~)
|
||||
|
||||
#define BOOST_LOCAL_FUNCTION_AUX_comma_bind_ref(z, bind_n, unused) \
|
||||
, BOOST_LOCAL_FUNCTION_AUX_bind_type(z, bind_n, ~) &
|
||||
|
||||
#define BOOST_LOCAL_FUNCTION_AUX_comma_bind_tparam(z, bind_n, unused) \
|
||||
, typename BOOST_LOCAL_FUNCTION_AUX_bind_type(z, bind_n, ~)
|
||||
|
||||
#define BOOST_LOCAL_FUNCTION_AUX_bind_name(z, bind_n, unused) \
|
||||
BOOST_PP_CAT(bing, bind_n)
|
||||
|
||||
#define BOOST_LOCAL_FUNCTION_AUX_comma_bind_param_decl(z, bind_n, unused) \
|
||||
, \
|
||||
BOOST_LOCAL_FUNCTION_AUX_bind_type(z, bind_n, ~) & \
|
||||
BOOST_LOCAL_FUNCTION_AUX_bind_name(z, bind_n, ~)
|
||||
|
||||
#define BOOST_LOCAL_FUNCTION_AUX_bind_member(z, bind_n, unsued) \
|
||||
BOOST_PP_CAT(BOOST_LOCAL_FUNCTION_AUX_bind_name(z, bind_n, ~), _)
|
||||
|
||||
#define BOOST_LOCAL_FUNCTION_AUX_comma_bind_member_deref(z, bind_n, unsued) \
|
||||
, member_deref< BOOST_LOCAL_FUNCTION_AUX_bind_type(z, bind_n, ~) >( \
|
||||
BOOST_LOCAL_FUNCTION_AUX_bind_member(z, bind_n, ~))
|
||||
|
||||
#define BOOST_LOCAL_FUNCTION_AUX_bind_member_init(z, bind_n, unused) \
|
||||
BOOST_LOCAL_FUNCTION_AUX_bind_member(z, bind_n, ~) = member_addr( \
|
||||
BOOST_LOCAL_FUNCTION_AUX_bind_name(z, bind_n, ~));
|
||||
|
||||
#define BOOST_LOCAL_FUNCTION_AUX_bind_member_decl(z, bind_n, unused) \
|
||||
/* must be ptr (not ref) so can use default constr */ \
|
||||
typename member_type< \
|
||||
BOOST_LOCAL_FUNCTION_AUX_bind_type(z, bind_n, ~) \
|
||||
>::pointer BOOST_LOCAL_FUNCTION_AUX_bind_member(z, bind_n, ~) ;
|
||||
|
||||
#define BOOST_LOCAL_FUNCTION_AUX_call_ptr(z, n, unused) \
|
||||
BOOST_PP_CAT(call_ptr, n)
|
||||
|
||||
#define BOOST_LOCAL_FUNCTION_AUX_call_name(z, n, unused) \
|
||||
BOOST_PP_CAT(call, n)
|
||||
|
||||
#define BOOST_LOCAL_FUNCTION_AUX_call_member(z, n, unused) \
|
||||
BOOST_PP_CAT(BOOST_LOCAL_FUNCTION_AUX_call_name(z, n, unused), _)
|
||||
|
||||
#define BOOST_LOCAL_FUNCTION_AUX_call_typedef(z, n, arity) \
|
||||
typedef R (*BOOST_LOCAL_FUNCTION_AUX_call_ptr(z, n, ~))( \
|
||||
object_ptr \
|
||||
BOOST_PP_IIF(BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS, \
|
||||
BOOST_PP_TUPLE_EAT(3) \
|
||||
, \
|
||||
BOOST_PP_REPEAT_ ## z \
|
||||
)(BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX, \
|
||||
BOOST_LOCAL_FUNCTION_AUX_comma_bind_ref, ~) \
|
||||
BOOST_PP_REPEAT_ ## z(BOOST_PP_SUB(arity, n), \
|
||||
BOOST_LOCAL_FUNCTION_AUX_arg_param_type, 1 /* leading comma */)\
|
||||
);
|
||||
|
||||
#define BOOST_LOCAL_FUNCTION_AUX_comma_call_param_decl(z, n, unused) \
|
||||
, \
|
||||
BOOST_LOCAL_FUNCTION_AUX_call_ptr(z, n, ~) \
|
||||
BOOST_LOCAL_FUNCTION_AUX_call_name(z, n, ~)
|
||||
|
||||
#define BOOST_LOCAL_FUNCTION_AUX_call_decl(z, n, unused) \
|
||||
BOOST_LOCAL_FUNCTION_AUX_call_ptr(z, n, ~) \
|
||||
BOOST_LOCAL_FUNCTION_AUX_call_member(z, n, ~);
|
||||
|
||||
#define BOOST_LOCAL_FUNCTION_AUX_call_init(z, n, unused) \
|
||||
BOOST_LOCAL_FUNCTION_AUX_call_member(z, n, ~) = \
|
||||
BOOST_LOCAL_FUNCTION_AUX_call_name(z, n, ~);
|
||||
|
||||
#define BOOST_LOCAL_FUNCTION_AUX_operator_call(z, defaults_n, arity) \
|
||||
/* precondition: object_ && call_function_ */ \
|
||||
inline R operator()( \
|
||||
BOOST_PP_ENUM_ ## z(BOOST_PP_SUB(arity, defaults_n), \
|
||||
BOOST_LOCAL_FUNCTION_AUX_arg_param_decl, ~) \
|
||||
) /* cannot be const because of binds (same as for local ftor) */ { \
|
||||
/* run-time: do not assert preconditions here for efficiency */ \
|
||||
/* run-time: this function call is done via a function pointer */ \
|
||||
/* so unfortunately does not allow for compiler inlining */ \
|
||||
/* optimizations (an alternative using virtual function was also */ \
|
||||
/* investigated but also virtual functions cannot be optimized */ \
|
||||
/* plus they require virtual table lookups to the alternative */ \
|
||||
/* performed worst) */ \
|
||||
return BOOST_LOCAL_FUNCTION_AUX_call_member(z, defaults_n, ~)( \
|
||||
object_ \
|
||||
BOOST_PP_IIF( \
|
||||
BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS,\
|
||||
BOOST_PP_TUPLE_EAT(3) \
|
||||
, \
|
||||
BOOST_PP_REPEAT_ ## z \
|
||||
)(BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX, \
|
||||
BOOST_LOCAL_FUNCTION_AUX_comma_bind_member_deref, ~) \
|
||||
BOOST_PP_REPEAT_ ## z(BOOST_PP_SUB(arity, defaults_n), \
|
||||
BOOST_LOCAL_FUNCTION_AUX_arg_name, 1 /* leading comma */) \
|
||||
); \
|
||||
}
|
||||
|
||||
namespace boost { namespace local_function { namespace aux {
|
||||
|
||||
template<
|
||||
typename F
|
||||
, size_t defaults
|
||||
#if !BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS
|
||||
BOOST_PP_REPEAT(BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX,
|
||||
BOOST_LOCAL_FUNCTION_AUX_comma_bind_tparam, ~)
|
||||
#endif
|
||||
>
|
||||
class function {}; // Empty template, only use its specializations.
|
||||
|
||||
// Iterate within namespace.
|
||||
# define BOOST_PP_ITERATION_PARAMS_1 \
|
||||
(3, (0, BOOST_LOCAL_FUNCTION_CONFIG_FUNCTION_ARITY_MAX, \
|
||||
BOOST_LOCAL_FUNCTION_AUX_FUNCTION_THIS_FILE_))
|
||||
# include BOOST_PP_ITERATE() // Iterate over function arity.
|
||||
|
||||
} } } // namespace
|
||||
|
||||
// Register type for type-of emu (NAME use TYPEOF to deduce this fctor type).
|
||||
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
|
||||
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::local_function::aux::function,
|
||||
(typename) // For `F` tparam.
|
||||
(size_t) // For `defaults` tparam.
|
||||
// MSVC error if using #if instead of PP_IIF here.
|
||||
BOOST_PP_IIF(BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS,
|
||||
BOOST_PP_TUPLE_EAT(3) // Nothing.
|
||||
,
|
||||
BOOST_PP_REPEAT // For bind tparams.
|
||||
)(BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX,
|
||||
BOOST_LOCAL_FUNCTION_AUX_typename_seq, ~)
|
||||
)
|
||||
|
||||
#undef BOOST_LOCAL_FUNCTION_AUX_typename_seq
|
||||
#undef BOOST_LOCAL_FUNCTION_AUX_arg_type
|
||||
#undef BOOST_LOCAL_FUNCTION_AUX_arg_typedef
|
||||
#undef BOOST_LOCAL_FUNCTION_AUX_comma_arg_tparam
|
||||
#undef BOOST_LOCAL_FUNCTION_AUX_arg_param_type
|
||||
#undef BOOST_LOCAL_FUNCTION_AUX_arg_name
|
||||
#undef BOOST_LOCAL_FUNCTION_AUX_arg_param_decl
|
||||
#undef BOOST_LOCAL_FUNCTION_AUX_bind_type
|
||||
#undef BOOST_LOCAL_FUNCTION_AUX_comma_bind_type
|
||||
#undef BOOST_LOCAL_FUNCTION_AUX_comma_bind_ref
|
||||
#undef BOOST_LOCAL_FUNCTION_AUX_comma_bind_tparam
|
||||
#undef BOOST_LOCAL_FUNCTION_AUX_bind_name
|
||||
#undef BOOST_LOCAL_FUNCTION_AUX_comma_bind_param_decl
|
||||
#undef BOOST_LOCAL_FUNCTION_AUX_bind_member
|
||||
#undef BOOST_LOCAL_FUNCTION_AUX_comma_bind_member_deref
|
||||
#undef BOOST_LOCAL_FUNCTION_AUX_bind_member_init
|
||||
#undef BOOST_LOCAL_FUNCTION_AUX_bind_member_decl
|
||||
#undef BOOST_LOCAL_FUNCTION_AUX_call_ptr
|
||||
#undef BOOST_LOCAL_FUNCTION_AUX_call_name
|
||||
#undef BOOST_LOCAL_FUNCTION_AUX_call_member
|
||||
#undef BOOST_LOCAL_FUNCTION_AUX_call_typedef
|
||||
#undef BOOST_LOCAL_FUNCTION_AUX_comma_call_param_decl
|
||||
#undef BOOST_LOCAL_FUNCTION_AUX_call_decl
|
||||
#undef BOOST_LOCAL_FUNCTION_AUX_call_init
|
||||
#undef BOOST_LOCAL_FUNCTION_AUX_operator_call
|
||||
|
||||
# endif // #include guard
|
||||
|
||||
#elif BOOST_PP_ITERATION_DEPTH() == 1
|
||||
# define BOOST_LOCAL_FUNCTION_AUX_arity BOOST_PP_FRAME_ITERATION(1)
|
||||
# define BOOST_PP_ITERATION_PARAMS_2 \
|
||||
(3, (0, BOOST_LOCAL_FUNCTION_AUX_arity, \
|
||||
BOOST_LOCAL_FUNCTION_AUX_FUNCTION_THIS_FILE_))
|
||||
# include BOOST_PP_ITERATE() // Iterate over default params count.
|
||||
# undef BOOST_LOCAL_FUNCTION_AUX_arity
|
||||
|
||||
#elif BOOST_PP_ITERATION_DEPTH() == 2
|
||||
# define BOOST_LOCAL_FUNCTION_AUX_defaults BOOST_PP_FRAME_ITERATION(2)
|
||||
|
||||
template<
|
||||
typename R
|
||||
BOOST_PP_REPEAT(BOOST_LOCAL_FUNCTION_AUX_arity,
|
||||
BOOST_LOCAL_FUNCTION_AUX_comma_arg_tparam, ~)
|
||||
#if !BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS
|
||||
BOOST_PP_REPEAT(BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX,
|
||||
BOOST_LOCAL_FUNCTION_AUX_comma_bind_tparam, ~)
|
||||
#endif
|
||||
>
|
||||
class function<
|
||||
R (
|
||||
BOOST_PP_ENUM(BOOST_LOCAL_FUNCTION_AUX_arity,
|
||||
BOOST_LOCAL_FUNCTION_AUX_arg_type, ~)
|
||||
)
|
||||
, BOOST_LOCAL_FUNCTION_AUX_defaults
|
||||
#if !BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS
|
||||
BOOST_PP_REPEAT(BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX,
|
||||
BOOST_LOCAL_FUNCTION_AUX_comma_bind_type, ~)
|
||||
#endif
|
||||
> {
|
||||
// The object type will actually be a local class which cannot be passed as
|
||||
// a template parameter so a generic `void*` pointer is used to hold the
|
||||
// object (this pointer will then be cased by the call-function implemented
|
||||
// by the local class itself). This is the trick used to pass a local
|
||||
// function as a template parameter. This trick uses function pointers for
|
||||
// the call-functions and function pointers cannot always be optimized by
|
||||
// the compiler (they cannot be inlined) thus this trick increased run-time
|
||||
// (another trick using virtual functions for the local class was also
|
||||
// investigated but also virtual functions cannot be inlined plus they
|
||||
// require virtual tables lookups so the virtual functions trick measured
|
||||
// worst run-time performance than the function pointer trick).
|
||||
typedef void* object_ptr;
|
||||
BOOST_PP_REPEAT(BOOST_PP_INC(BOOST_LOCAL_FUNCTION_AUX_defaults),
|
||||
BOOST_LOCAL_FUNCTION_AUX_call_typedef, // INC for no defaults.
|
||||
BOOST_LOCAL_FUNCTION_AUX_arity)
|
||||
|
||||
public:
|
||||
// Provide public type interface following Boost.Function names
|
||||
// (traits must be defined in both this and the local functor).
|
||||
BOOST_STATIC_CONSTANT(size_t, arity = BOOST_LOCAL_FUNCTION_AUX_arity);
|
||||
typedef R result_type;
|
||||
BOOST_PP_REPEAT(BOOST_LOCAL_FUNCTION_AUX_arity,
|
||||
BOOST_LOCAL_FUNCTION_AUX_arg_typedef, ~)
|
||||
|
||||
// NOTE: Must have default constructor for init without function name in
|
||||
// function macro expansion.
|
||||
|
||||
// Cannot be private but it should never be used by programmers directly
|
||||
// so used internal symbol.
|
||||
inline void BOOST_LOCAL_FUNCTION_AUX_FUNCTION_INIT_CALL_FUNC(
|
||||
object_ptr object
|
||||
#if !BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS
|
||||
BOOST_PP_REPEAT(BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX,
|
||||
BOOST_LOCAL_FUNCTION_AUX_comma_bind_param_decl, ~)
|
||||
#endif
|
||||
BOOST_PP_REPEAT(BOOST_PP_INC(BOOST_LOCAL_FUNCTION_AUX_defaults),
|
||||
BOOST_LOCAL_FUNCTION_AUX_comma_call_param_decl, ~)
|
||||
) {
|
||||
object_ = object;
|
||||
#if !BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS
|
||||
BOOST_PP_REPEAT(BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX,
|
||||
BOOST_LOCAL_FUNCTION_AUX_bind_member_init, ~)
|
||||
#endif
|
||||
BOOST_PP_REPEAT(BOOST_PP_INC(BOOST_LOCAL_FUNCTION_AUX_defaults),
|
||||
BOOST_LOCAL_FUNCTION_AUX_call_init, ~) // INC for no defaults.
|
||||
unused_ = 0; // To avoid a GCC uninitialized warning.
|
||||
}
|
||||
|
||||
// Result operator(Arg1, ..., ArgN-1, ArgN) -- iff defaults >= 0
|
||||
// Result operator(Arg1, ..., ArgN-1) -- iff defaults >= 1
|
||||
// ... -- etc
|
||||
BOOST_PP_REPEAT(BOOST_PP_INC(BOOST_LOCAL_FUNCTION_AUX_defaults),
|
||||
BOOST_LOCAL_FUNCTION_AUX_operator_call, // INC for no defaults.
|
||||
BOOST_LOCAL_FUNCTION_AUX_arity)
|
||||
|
||||
private:
|
||||
object_ptr object_;
|
||||
#if !BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS
|
||||
BOOST_PP_REPEAT(BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX,
|
||||
BOOST_LOCAL_FUNCTION_AUX_bind_member_decl, ~)
|
||||
#endif
|
||||
BOOST_PP_REPEAT(BOOST_PP_INC(BOOST_LOCAL_FUNCTION_AUX_defaults),
|
||||
BOOST_LOCAL_FUNCTION_AUX_call_decl, ~) // INC for no defaults.
|
||||
|
||||
// run-time: this unused void* member variable allows for compiler
|
||||
// optimizations (at least on MSVC it reduces invocation time of about 50%)
|
||||
void* unused_;
|
||||
};
|
||||
|
||||
# undef BOOST_LOCAL_FUNCTION_AUX_defaults
|
||||
#endif // iteration
|
||||
|
||||
|
||||
// Copyright (C) 2009-2012 Lorenzo Caminiti
|
||||
// Distributed under the Boost Software License, Version 1.0
|
||||
// (see accompanying file LICENSE_1_0.txt or a copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
// Home at http://www.boost.org/libs/local_function
|
||||
|
||||
#if !BOOST_PP_IS_ITERATING
|
||||
# ifndef BOOST_LOCAL_FUNCTION_AUX_FUNCTION_HPP_
|
||||
# define BOOST_LOCAL_FUNCTION_AUX_FUNCTION_HPP_
|
||||
|
||||
# include <boost/local_function/config.hpp>
|
||||
# include <boost/local_function/aux_/member.hpp>
|
||||
# include <boost/call_traits.hpp>
|
||||
# include <boost/typeof/typeof.hpp>
|
||||
# include <boost/config.hpp>
|
||||
# include <boost/preprocessor/iteration/iterate.hpp>
|
||||
# include <boost/preprocessor/repetition/repeat.hpp>
|
||||
# include <boost/preprocessor/repetition/enum.hpp>
|
||||
# include <boost/preprocessor/punctuation/comma_if.hpp>
|
||||
# include <boost/preprocessor/arithmetic/add.hpp>
|
||||
# include <boost/preprocessor/arithmetic/sub.hpp>
|
||||
# include <boost/preprocessor/arithmetic/inc.hpp>
|
||||
# include <boost/preprocessor/control/iif.hpp>
|
||||
# include <boost/preprocessor/cat.hpp>
|
||||
|
||||
// PRIVATE //
|
||||
|
||||
#define BOOST_LOCAL_FUNCTION_AUX_FUNCTION_THIS_FILE_ \
|
||||
"boost/local_function/aux_/function.hpp"
|
||||
|
||||
// PUBLIC //
|
||||
|
||||
#define BOOST_LOCAL_FUNCTION_AUX_FUNCTION_INIT_CALL_FUNC \
|
||||
BOOST_LOCAL_FUNCTION_AUX_SYMBOL( (init_call) )
|
||||
|
||||
#define BOOST_LOCAL_FUNCTION_AUX_typename_seq(z, n, unused) \
|
||||
(typename)
|
||||
|
||||
#define BOOST_LOCAL_FUNCTION_AUX_arg_type(z, arg_n, unused) \
|
||||
BOOST_PP_CAT(Arg, arg_n)
|
||||
|
||||
#define BOOST_LOCAL_FUNCTION_AUX_arg_typedef(z, arg_n, unused) \
|
||||
typedef \
|
||||
BOOST_LOCAL_FUNCTION_AUX_arg_type(z, arg_n, ~) \
|
||||
/* name must follow Boost.FunctionTraits arg1_type, arg2_type, ... */ \
|
||||
BOOST_PP_CAT(BOOST_PP_CAT(arg, BOOST_PP_INC(arg_n)), _type) \
|
||||
;
|
||||
|
||||
#define BOOST_LOCAL_FUNCTION_AUX_comma_arg_tparam(z, arg_n, unused) \
|
||||
, typename BOOST_LOCAL_FUNCTION_AUX_arg_type(z, arg_n, ~)
|
||||
|
||||
#define BOOST_LOCAL_FUNCTION_AUX_arg_param_type(z, arg_n, comma01) \
|
||||
BOOST_PP_COMMA_IF(comma01) \
|
||||
typename ::boost::call_traits< \
|
||||
BOOST_LOCAL_FUNCTION_AUX_arg_type(z, arg_n, ~) \
|
||||
>::param_type
|
||||
|
||||
#define BOOST_LOCAL_FUNCTION_AUX_arg_name(z, arg_n, comma01) \
|
||||
BOOST_PP_COMMA_IF(comma01) \
|
||||
BOOST_PP_CAT(arg, arg_n)
|
||||
|
||||
#define BOOST_LOCAL_FUNCTION_AUX_arg_param_decl(z, arg_n, unused) \
|
||||
BOOST_LOCAL_FUNCTION_AUX_arg_param_type(z, arg_n, 0 /* no leading comma */)\
|
||||
BOOST_LOCAL_FUNCTION_AUX_arg_name(z, arg_n, 0 /* no leading comma */)
|
||||
|
||||
#define BOOST_LOCAL_FUNCTION_AUX_bind_type(z, bind_n, unused) \
|
||||
BOOST_PP_CAT(Bind, bind_n)
|
||||
|
||||
#define BOOST_LOCAL_FUNCTION_AUX_comma_bind_type(z, bind_n, unused) \
|
||||
, BOOST_LOCAL_FUNCTION_AUX_bind_type(z, bind_n, ~)
|
||||
|
||||
#define BOOST_LOCAL_FUNCTION_AUX_comma_bind_ref(z, bind_n, unused) \
|
||||
, BOOST_LOCAL_FUNCTION_AUX_bind_type(z, bind_n, ~) &
|
||||
|
||||
#define BOOST_LOCAL_FUNCTION_AUX_comma_bind_tparam(z, bind_n, unused) \
|
||||
, typename BOOST_LOCAL_FUNCTION_AUX_bind_type(z, bind_n, ~)
|
||||
|
||||
#define BOOST_LOCAL_FUNCTION_AUX_bind_name(z, bind_n, unused) \
|
||||
BOOST_PP_CAT(bing, bind_n)
|
||||
|
||||
#define BOOST_LOCAL_FUNCTION_AUX_comma_bind_param_decl(z, bind_n, unused) \
|
||||
, \
|
||||
BOOST_LOCAL_FUNCTION_AUX_bind_type(z, bind_n, ~) & \
|
||||
BOOST_LOCAL_FUNCTION_AUX_bind_name(z, bind_n, ~)
|
||||
|
||||
#define BOOST_LOCAL_FUNCTION_AUX_bind_member(z, bind_n, unsued) \
|
||||
BOOST_PP_CAT(BOOST_LOCAL_FUNCTION_AUX_bind_name(z, bind_n, ~), _)
|
||||
|
||||
#define BOOST_LOCAL_FUNCTION_AUX_comma_bind_member_deref(z, bind_n, unsued) \
|
||||
, member_deref< BOOST_LOCAL_FUNCTION_AUX_bind_type(z, bind_n, ~) >( \
|
||||
BOOST_LOCAL_FUNCTION_AUX_bind_member(z, bind_n, ~))
|
||||
|
||||
#define BOOST_LOCAL_FUNCTION_AUX_bind_member_init(z, bind_n, unused) \
|
||||
BOOST_LOCAL_FUNCTION_AUX_bind_member(z, bind_n, ~) = member_addr( \
|
||||
BOOST_LOCAL_FUNCTION_AUX_bind_name(z, bind_n, ~));
|
||||
|
||||
#define BOOST_LOCAL_FUNCTION_AUX_bind_member_decl(z, bind_n, unused) \
|
||||
/* must be ptr (not ref) so can use default constr */ \
|
||||
typename member_type< \
|
||||
BOOST_LOCAL_FUNCTION_AUX_bind_type(z, bind_n, ~) \
|
||||
>::pointer BOOST_LOCAL_FUNCTION_AUX_bind_member(z, bind_n, ~) ;
|
||||
|
||||
#define BOOST_LOCAL_FUNCTION_AUX_call_ptr(z, n, unused) \
|
||||
BOOST_PP_CAT(call_ptr, n)
|
||||
|
||||
#define BOOST_LOCAL_FUNCTION_AUX_call_name(z, n, unused) \
|
||||
BOOST_PP_CAT(call, n)
|
||||
|
||||
#define BOOST_LOCAL_FUNCTION_AUX_call_member(z, n, unused) \
|
||||
BOOST_PP_CAT(BOOST_LOCAL_FUNCTION_AUX_call_name(z, n, unused), _)
|
||||
|
||||
#define BOOST_LOCAL_FUNCTION_AUX_call_typedef(z, n, arity) \
|
||||
typedef R (*BOOST_LOCAL_FUNCTION_AUX_call_ptr(z, n, ~))( \
|
||||
object_ptr \
|
||||
BOOST_PP_IIF(BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS, \
|
||||
BOOST_PP_TUPLE_EAT(3) \
|
||||
, \
|
||||
BOOST_PP_REPEAT_ ## z \
|
||||
)(BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX, \
|
||||
BOOST_LOCAL_FUNCTION_AUX_comma_bind_ref, ~) \
|
||||
BOOST_PP_REPEAT_ ## z(BOOST_PP_SUB(arity, n), \
|
||||
BOOST_LOCAL_FUNCTION_AUX_arg_param_type, 1 /* leading comma */)\
|
||||
);
|
||||
|
||||
#define BOOST_LOCAL_FUNCTION_AUX_comma_call_param_decl(z, n, unused) \
|
||||
, \
|
||||
BOOST_LOCAL_FUNCTION_AUX_call_ptr(z, n, ~) \
|
||||
BOOST_LOCAL_FUNCTION_AUX_call_name(z, n, ~)
|
||||
|
||||
#define BOOST_LOCAL_FUNCTION_AUX_call_decl(z, n, unused) \
|
||||
BOOST_LOCAL_FUNCTION_AUX_call_ptr(z, n, ~) \
|
||||
BOOST_LOCAL_FUNCTION_AUX_call_member(z, n, ~);
|
||||
|
||||
#define BOOST_LOCAL_FUNCTION_AUX_call_init(z, n, unused) \
|
||||
BOOST_LOCAL_FUNCTION_AUX_call_member(z, n, ~) = \
|
||||
BOOST_LOCAL_FUNCTION_AUX_call_name(z, n, ~);
|
||||
|
||||
#define BOOST_LOCAL_FUNCTION_AUX_operator_call(z, defaults_n, arity) \
|
||||
/* precondition: object_ && call_function_ */ \
|
||||
inline R operator()( \
|
||||
BOOST_PP_ENUM_ ## z(BOOST_PP_SUB(arity, defaults_n), \
|
||||
BOOST_LOCAL_FUNCTION_AUX_arg_param_decl, ~) \
|
||||
) /* cannot be const because of binds (same as for local ftor) */ { \
|
||||
/* run-time: do not assert preconditions here for efficiency */ \
|
||||
/* run-time: this function call is done via a function pointer */ \
|
||||
/* so unfortunately does not allow for compiler inlining */ \
|
||||
/* optimizations (an alternative using virtual function was also */ \
|
||||
/* investigated but also virtual functions cannot be optimized */ \
|
||||
/* plus they require virtual table lookups to the alternative */ \
|
||||
/* performed worst) */ \
|
||||
return BOOST_LOCAL_FUNCTION_AUX_call_member(z, defaults_n, ~)( \
|
||||
object_ \
|
||||
BOOST_PP_IIF( \
|
||||
BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS,\
|
||||
BOOST_PP_TUPLE_EAT(3) \
|
||||
, \
|
||||
BOOST_PP_REPEAT_ ## z \
|
||||
)(BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX, \
|
||||
BOOST_LOCAL_FUNCTION_AUX_comma_bind_member_deref, ~) \
|
||||
BOOST_PP_REPEAT_ ## z(BOOST_PP_SUB(arity, defaults_n), \
|
||||
BOOST_LOCAL_FUNCTION_AUX_arg_name, 1 /* leading comma */) \
|
||||
); \
|
||||
}
|
||||
|
||||
namespace boost { namespace local_function { namespace aux {
|
||||
|
||||
template<
|
||||
typename F
|
||||
, size_t defaults
|
||||
#if !BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS
|
||||
BOOST_PP_REPEAT(BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX,
|
||||
BOOST_LOCAL_FUNCTION_AUX_comma_bind_tparam, ~)
|
||||
#endif
|
||||
>
|
||||
class function {}; // Empty template, only use its specializations.
|
||||
|
||||
// Iterate within namespace.
|
||||
# define BOOST_PP_ITERATION_PARAMS_1 \
|
||||
(3, (0, BOOST_LOCAL_FUNCTION_CONFIG_FUNCTION_ARITY_MAX, \
|
||||
BOOST_LOCAL_FUNCTION_AUX_FUNCTION_THIS_FILE_))
|
||||
# include BOOST_PP_ITERATE() // Iterate over function arity.
|
||||
|
||||
} } } // namespace
|
||||
|
||||
// Register type for type-of emu (NAME use TYPEOF to deduce this fctor type).
|
||||
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
|
||||
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::local_function::aux::function,
|
||||
(typename) // For `F` tparam.
|
||||
(size_t) // For `defaults` tparam.
|
||||
// MSVC error if using #if instead of PP_IIF here.
|
||||
BOOST_PP_IIF(BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS,
|
||||
BOOST_PP_TUPLE_EAT(3) // Nothing.
|
||||
,
|
||||
BOOST_PP_REPEAT // For bind tparams.
|
||||
)(BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX,
|
||||
BOOST_LOCAL_FUNCTION_AUX_typename_seq, ~)
|
||||
)
|
||||
|
||||
#undef BOOST_LOCAL_FUNCTION_AUX_typename_seq
|
||||
#undef BOOST_LOCAL_FUNCTION_AUX_arg_type
|
||||
#undef BOOST_LOCAL_FUNCTION_AUX_arg_typedef
|
||||
#undef BOOST_LOCAL_FUNCTION_AUX_comma_arg_tparam
|
||||
#undef BOOST_LOCAL_FUNCTION_AUX_arg_param_type
|
||||
#undef BOOST_LOCAL_FUNCTION_AUX_arg_name
|
||||
#undef BOOST_LOCAL_FUNCTION_AUX_arg_param_decl
|
||||
#undef BOOST_LOCAL_FUNCTION_AUX_bind_type
|
||||
#undef BOOST_LOCAL_FUNCTION_AUX_comma_bind_type
|
||||
#undef BOOST_LOCAL_FUNCTION_AUX_comma_bind_ref
|
||||
#undef BOOST_LOCAL_FUNCTION_AUX_comma_bind_tparam
|
||||
#undef BOOST_LOCAL_FUNCTION_AUX_bind_name
|
||||
#undef BOOST_LOCAL_FUNCTION_AUX_comma_bind_param_decl
|
||||
#undef BOOST_LOCAL_FUNCTION_AUX_bind_member
|
||||
#undef BOOST_LOCAL_FUNCTION_AUX_comma_bind_member_deref
|
||||
#undef BOOST_LOCAL_FUNCTION_AUX_bind_member_init
|
||||
#undef BOOST_LOCAL_FUNCTION_AUX_bind_member_decl
|
||||
#undef BOOST_LOCAL_FUNCTION_AUX_call_ptr
|
||||
#undef BOOST_LOCAL_FUNCTION_AUX_call_name
|
||||
#undef BOOST_LOCAL_FUNCTION_AUX_call_member
|
||||
#undef BOOST_LOCAL_FUNCTION_AUX_call_typedef
|
||||
#undef BOOST_LOCAL_FUNCTION_AUX_comma_call_param_decl
|
||||
#undef BOOST_LOCAL_FUNCTION_AUX_call_decl
|
||||
#undef BOOST_LOCAL_FUNCTION_AUX_call_init
|
||||
#undef BOOST_LOCAL_FUNCTION_AUX_operator_call
|
||||
|
||||
# endif // #include guard
|
||||
|
||||
#else if BOOST_PP_ITERATION_DEPTH() == 1
|
||||
# define BOOST_LOCAL_FUNCTION_AUX_arity BOOST_PP_FRAME_ITERATION(1)
|
||||
# define BOOST_PP_ITERATION_PARAMS_2 \
|
||||
(3, (0, BOOST_LOCAL_FUNCTION_AUX_arity, \
|
||||
BOOST_LOCAL_FUNCTION_AUX_FUNCTION_THIS_FILE_))
|
||||
# include BOOST_PP_ITERATE() // Iterate over default params count.
|
||||
# undef BOOST_LOCAL_FUNCTION_AUX_arity
|
||||
|
||||
#else if BOOST_PP_ITERATION_DEPTH() == 2
|
||||
# define BOOST_LOCAL_FUNCTION_AUX_defaults BOOST_PP_FRAME_ITERATION(2)
|
||||
|
||||
template<
|
||||
typename R
|
||||
BOOST_PP_REPEAT(BOOST_LOCAL_FUNCTION_AUX_arity,
|
||||
BOOST_LOCAL_FUNCTION_AUX_comma_arg_tparam, ~)
|
||||
#if !BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS
|
||||
BOOST_PP_REPEAT(BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX,
|
||||
BOOST_LOCAL_FUNCTION_AUX_comma_bind_tparam, ~)
|
||||
#endif
|
||||
>
|
||||
class function<
|
||||
R (
|
||||
BOOST_PP_ENUM(BOOST_LOCAL_FUNCTION_AUX_arity,
|
||||
BOOST_LOCAL_FUNCTION_AUX_arg_type, ~)
|
||||
)
|
||||
, BOOST_LOCAL_FUNCTION_AUX_defaults
|
||||
#if !BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS
|
||||
BOOST_PP_REPEAT(BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX,
|
||||
BOOST_LOCAL_FUNCTION_AUX_comma_bind_type, ~)
|
||||
#endif
|
||||
> {
|
||||
// The object type will actually be a local class which cannot be passed as
|
||||
// a template parameter so a generic `void*` pointer is used to hold the
|
||||
// object (this pointer will then be cased by the call-function implemented
|
||||
// by the local class itself). This is the trick used to pass a local
|
||||
// function as a template parameter. This trick uses function pointers for
|
||||
// the call-functions and function pointers cannot always be optimized by
|
||||
// the compiler (they cannot be inlined) thus this trick increased run-time
|
||||
// (another trick using virtual functions for the local class was also
|
||||
// investigated but also virtual functions cannot be inlined plus they
|
||||
// require virtual tables lookups so the virtual functions trick measured
|
||||
// worst run-time performance than the function pointer trick).
|
||||
typedef void* object_ptr;
|
||||
BOOST_PP_REPEAT(BOOST_PP_INC(BOOST_LOCAL_FUNCTION_AUX_defaults),
|
||||
BOOST_LOCAL_FUNCTION_AUX_call_typedef, // INC for no defaults.
|
||||
BOOST_LOCAL_FUNCTION_AUX_arity)
|
||||
|
||||
public:
|
||||
// Provide public type interface following Boost.Function names
|
||||
// (traits must be defined in both this and the local functor).
|
||||
BOOST_STATIC_CONSTANT(size_t, arity = BOOST_LOCAL_FUNCTION_AUX_arity);
|
||||
typedef R result_type;
|
||||
BOOST_PP_REPEAT(BOOST_LOCAL_FUNCTION_AUX_arity,
|
||||
BOOST_LOCAL_FUNCTION_AUX_arg_typedef, ~)
|
||||
|
||||
// NOTE: Must have default constructor for init without function name in
|
||||
// function macro expansion.
|
||||
|
||||
// Cannot be private but it should never be used by programmers directly
|
||||
// so used internal symbol.
|
||||
inline void BOOST_LOCAL_FUNCTION_AUX_FUNCTION_INIT_CALL_FUNC(
|
||||
object_ptr object
|
||||
#if !BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS
|
||||
BOOST_PP_REPEAT(BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX,
|
||||
BOOST_LOCAL_FUNCTION_AUX_comma_bind_param_decl, ~)
|
||||
#endif
|
||||
BOOST_PP_REPEAT(BOOST_PP_INC(BOOST_LOCAL_FUNCTION_AUX_defaults),
|
||||
BOOST_LOCAL_FUNCTION_AUX_comma_call_param_decl, ~)
|
||||
) {
|
||||
object_ = object;
|
||||
#if !BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS
|
||||
BOOST_PP_REPEAT(BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX,
|
||||
BOOST_LOCAL_FUNCTION_AUX_bind_member_init, ~)
|
||||
#endif
|
||||
BOOST_PP_REPEAT(BOOST_PP_INC(BOOST_LOCAL_FUNCTION_AUX_defaults),
|
||||
BOOST_LOCAL_FUNCTION_AUX_call_init, ~) // INC for no defaults.
|
||||
unused_ = 0; // To avoid a GCC uninitialized warning.
|
||||
}
|
||||
|
||||
// Result operator(Arg1, ..., ArgN-1, ArgN) -- iff defaults >= 0
|
||||
// Result operator(Arg1, ..., ArgN-1) -- iff defaults >= 1
|
||||
// ... -- etc
|
||||
BOOST_PP_REPEAT(BOOST_PP_INC(BOOST_LOCAL_FUNCTION_AUX_defaults),
|
||||
BOOST_LOCAL_FUNCTION_AUX_operator_call, // INC for no defaults.
|
||||
BOOST_LOCAL_FUNCTION_AUX_arity)
|
||||
|
||||
private:
|
||||
object_ptr object_;
|
||||
#if !BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS
|
||||
BOOST_PP_REPEAT(BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX,
|
||||
BOOST_LOCAL_FUNCTION_AUX_bind_member_decl, ~)
|
||||
#endif
|
||||
BOOST_PP_REPEAT(BOOST_PP_INC(BOOST_LOCAL_FUNCTION_AUX_defaults),
|
||||
BOOST_LOCAL_FUNCTION_AUX_call_decl, ~) // INC for no defaults.
|
||||
|
||||
// run-time: this unused void* member variable allows for compiler
|
||||
// optimizations (at least on MSVC it reduces invocation time of about 50%)
|
||||
void* unused_;
|
||||
};
|
||||
|
||||
# undef BOOST_LOCAL_FUNCTION_AUX_defaults
|
||||
#endif // iteration
|
||||
|
||||
|
|
468
mp/src/thirdparty/boost/mpl/apply_wrap.hpp
vendored
468
mp/src/thirdparty/boost/mpl/apply_wrap.hpp
vendored
|
@ -1,234 +1,234 @@
|
|||
|
||||
#if !defined(BOOST_PP_IS_ITERATING)
|
||||
|
||||
///// header body
|
||||
|
||||
#ifndef BOOST_MPL_APPLY_WRAP_HPP_INCLUDED
|
||||
#define BOOST_MPL_APPLY_WRAP_HPP_INCLUDED
|
||||
|
||||
// Copyright Aleksey Gurtovoy 2000-2008
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// See http://www.boost.org/libs/mpl for documentation.
|
||||
|
||||
// $Id: apply_wrap.hpp 49272 2008-10-11 06:50:46Z agurtovoy $
|
||||
// $Date: 2008-10-10 23:50:46 -0700 (Fri, 10 Oct 2008) $
|
||||
// $Revision: 49272 $
|
||||
|
||||
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
|
||||
# include <boost/mpl/aux_/arity.hpp>
|
||||
# include <boost/mpl/aux_/has_apply.hpp>
|
||||
# include <boost/mpl/aux_/na.hpp>
|
||||
# include <boost/mpl/aux_/msvc_never_true.hpp>
|
||||
#endif
|
||||
|
||||
#include <boost/mpl/aux_/config/use_preprocessed.hpp>
|
||||
|
||||
#if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \
|
||||
&& !defined(BOOST_MPL_PREPROCESSING_MODE)
|
||||
|
||||
# define BOOST_MPL_PREPROCESSED_HEADER apply_wrap.hpp
|
||||
# include <boost/mpl/aux_/include_preprocessed.hpp>
|
||||
|
||||
#else
|
||||
|
||||
# include <boost/mpl/limits/arity.hpp>
|
||||
# include <boost/mpl/aux_/preprocessor/params.hpp>
|
||||
# include <boost/mpl/aux_/preprocessor/enum.hpp>
|
||||
# include <boost/mpl/aux_/preprocessor/add.hpp>
|
||||
# include <boost/mpl/aux_/config/bcc.hpp>
|
||||
# include <boost/mpl/aux_/config/ctps.hpp>
|
||||
# include <boost/mpl/aux_/config/dtp.hpp>
|
||||
# include <boost/mpl/aux_/config/eti.hpp>
|
||||
# include <boost/mpl/aux_/config/msvc.hpp>
|
||||
# include <boost/mpl/aux_/config/workaround.hpp>
|
||||
|
||||
# include <boost/preprocessor/comma_if.hpp>
|
||||
# include <boost/preprocessor/logical/and.hpp>
|
||||
# include <boost/preprocessor/inc.hpp>
|
||||
# include <boost/preprocessor/iterate.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace mpl {
|
||||
|
||||
// local macros, #undef-ined at the end of the header
|
||||
# define AUX778076_APPLY_WRAP_PARAMS(n, param) \
|
||||
BOOST_MPL_PP_PARAMS(n, param) \
|
||||
/**/
|
||||
|
||||
# define AUX778076_APPLY_WRAP_SPEC_PARAMS(n, param) \
|
||||
BOOST_MPL_PP_ENUM(BOOST_PP_INC(n), param) \
|
||||
/**/
|
||||
|
||||
|
||||
#define BOOST_PP_ITERATION_PARAMS_1 \
|
||||
(3,(0, BOOST_MPL_LIMIT_METAFUNCTION_ARITY, <boost/mpl/apply_wrap.hpp>))
|
||||
#include BOOST_PP_ITERATE()
|
||||
|
||||
|
||||
# undef AUX778076_APPLY_WRAP_SPEC_PARAMS
|
||||
# undef AUX778076_APPLY_WRAP_PARAMS
|
||||
|
||||
}}
|
||||
|
||||
#endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
|
||||
#endif // BOOST_MPL_APPLY_WRAP_HPP_INCLUDED
|
||||
|
||||
///// iteration, depth == 1
|
||||
|
||||
// For gcc 4.4 compatability, we must include the
|
||||
// BOOST_PP_ITERATION_DEPTH test inside an #else clause.
|
||||
#else // BOOST_PP_IS_ITERATING
|
||||
#if BOOST_PP_ITERATION_DEPTH() == 1
|
||||
|
||||
# define i_ BOOST_PP_FRAME_ITERATION(1)
|
||||
|
||||
# if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
||||
// MSVC version
|
||||
|
||||
#define AUX778076_MSVC_DTW_NAME BOOST_PP_CAT(msvc_apply,i_)
|
||||
#define AUX778076_MSVC_DTW_ORIGINAL_NAME apply
|
||||
#define AUX778076_MSVC_DTW_ARITY i_
|
||||
#include <boost/mpl/aux_/msvc_dtw.hpp>
|
||||
|
||||
template<
|
||||
typename F BOOST_PP_COMMA_IF(i_) AUX778076_APPLY_WRAP_PARAMS(i_, typename T)
|
||||
>
|
||||
struct BOOST_PP_CAT(apply_wrap,i_)
|
||||
{
|
||||
// Metafunction forwarding confuses vc6
|
||||
typedef typename BOOST_PP_CAT(msvc_apply,i_)<F>::template result_<
|
||||
AUX778076_APPLY_WRAP_PARAMS(i_, T)
|
||||
>::type type;
|
||||
};
|
||||
|
||||
# elif defined(BOOST_MPL_CFG_BROKEN_DEFAULT_PARAMETERS_IN_NESTED_TEMPLATES)
|
||||
// MWCW/Borland version
|
||||
|
||||
template<
|
||||
int N, typename F BOOST_PP_COMMA_IF(i_) AUX778076_APPLY_WRAP_PARAMS(i_, typename T)
|
||||
>
|
||||
struct BOOST_PP_CAT(apply_wrap_impl,i_);
|
||||
|
||||
#define BOOST_PP_ITERATION_PARAMS_2 \
|
||||
(3,(0, BOOST_MPL_LIMIT_METAFUNCTION_ARITY - i_, <boost/mpl/apply_wrap.hpp>))
|
||||
#include BOOST_PP_ITERATE()
|
||||
|
||||
template<
|
||||
typename F BOOST_PP_COMMA_IF(i_) AUX778076_APPLY_WRAP_PARAMS(i_, typename T)
|
||||
>
|
||||
struct BOOST_PP_CAT(apply_wrap,i_)
|
||||
: BOOST_PP_CAT(apply_wrap_impl,i_)<
|
||||
::boost::mpl::aux::arity<F,i_>::value
|
||||
, F
|
||||
BOOST_PP_COMMA_IF(i_) AUX778076_APPLY_WRAP_PARAMS(i_, T)
|
||||
>::type
|
||||
{
|
||||
};
|
||||
|
||||
# else
|
||||
// ISO98 C++, with minor concession to vc7
|
||||
|
||||
template<
|
||||
typename F BOOST_PP_COMMA_IF(i_) AUX778076_APPLY_WRAP_PARAMS(i_, typename T)
|
||||
#if i_ == 0
|
||||
, typename has_apply_ = typename aux::has_apply<F>::type
|
||||
#endif
|
||||
>
|
||||
struct BOOST_PP_CAT(apply_wrap,i_)
|
||||
// metafunction forwarding confuses MSVC 7.0
|
||||
#if !BOOST_WORKAROUND(BOOST_MSVC, == 1300)
|
||||
: F::template apply< AUX778076_APPLY_WRAP_PARAMS(i_, T) >
|
||||
{
|
||||
#else
|
||||
{
|
||||
typedef typename F::template apply<
|
||||
AUX778076_APPLY_WRAP_PARAMS(i_, T)
|
||||
>::type type;
|
||||
#endif
|
||||
};
|
||||
|
||||
#if i_ == 0 && !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
||||
template< typename F >
|
||||
struct BOOST_PP_CAT(apply_wrap,i_)<F,true_>
|
||||
: F::apply
|
||||
{
|
||||
};
|
||||
#endif
|
||||
|
||||
# endif // workarounds
|
||||
|
||||
#if defined(BOOST_MPL_CFG_MSVC_ETI_BUG)
|
||||
/// workaround for ETI bug
|
||||
template<>
|
||||
struct BOOST_PP_CAT(apply_wrap,i_)<AUX778076_APPLY_WRAP_SPEC_PARAMS(i_, int)>
|
||||
{
|
||||
typedef int type;
|
||||
};
|
||||
#endif
|
||||
|
||||
# undef i_
|
||||
|
||||
///// iteration, depth == 2
|
||||
|
||||
#elif BOOST_PP_ITERATION_DEPTH() == 2
|
||||
|
||||
# define j_ BOOST_PP_FRAME_ITERATION(2)
|
||||
|
||||
#if i_ == 0 && j_ == 0 \
|
||||
&& defined(BOOST_MPL_CFG_BCC590_WORKAROUNDS) \
|
||||
&& !defined(BOOST_MPL_CFG_NO_HAS_APPLY)
|
||||
|
||||
template< typename F, bool F_has_apply >
|
||||
struct apply_wrap_impl0_bcb {
|
||||
typedef typename F::template apply< na > type;
|
||||
};
|
||||
|
||||
template< typename F >
|
||||
struct apply_wrap_impl0_bcb< F, true > {
|
||||
typedef typename F::apply type;
|
||||
};
|
||||
|
||||
template<
|
||||
typename F BOOST_PP_COMMA_IF(i_) AUX778076_APPLY_WRAP_PARAMS(i_, typename T)
|
||||
>
|
||||
struct BOOST_PP_CAT(apply_wrap_impl,i_)<
|
||||
BOOST_MPL_PP_ADD(i_, j_)
|
||||
, F
|
||||
BOOST_PP_COMMA_IF(i_) AUX778076_APPLY_WRAP_PARAMS(i_, T)
|
||||
>
|
||||
{
|
||||
typedef apply_wrap_impl0_bcb< F, aux::has_apply< F >::value >::type type;
|
||||
};
|
||||
#else
|
||||
|
||||
template<
|
||||
typename F BOOST_PP_COMMA_IF(i_) AUX778076_APPLY_WRAP_PARAMS(i_, typename T)
|
||||
>
|
||||
struct BOOST_PP_CAT(apply_wrap_impl,i_)<
|
||||
BOOST_MPL_PP_ADD(i_, j_)
|
||||
, F
|
||||
BOOST_PP_COMMA_IF(i_) AUX778076_APPLY_WRAP_PARAMS(i_, T)
|
||||
>
|
||||
{
|
||||
typedef typename F::template apply<
|
||||
AUX778076_APPLY_WRAP_PARAMS(i_, T)
|
||||
#if i_ == 0 && j_ == 0
|
||||
/// since the defaults are "lost", we have to pass *something* even for nullary
|
||||
/// metafunction classes
|
||||
na
|
||||
#else
|
||||
BOOST_PP_COMMA_IF(BOOST_PP_AND(i_, j_)) BOOST_MPL_PP_ENUM(j_, na)
|
||||
#endif
|
||||
> type;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
# undef j_
|
||||
|
||||
#endif // BOOST_PP_ITERATION_DEPTH()
|
||||
#endif // BOOST_PP_IS_ITERATING
|
||||
|
||||
#if !defined(BOOST_PP_IS_ITERATING)
|
||||
|
||||
///// header body
|
||||
|
||||
#ifndef BOOST_MPL_APPLY_WRAP_HPP_INCLUDED
|
||||
#define BOOST_MPL_APPLY_WRAP_HPP_INCLUDED
|
||||
|
||||
// Copyright Aleksey Gurtovoy 2000-2008
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// See http://www.boost.org/libs/mpl for documentation.
|
||||
|
||||
// $Id: apply_wrap.hpp 49272 2008-10-11 06:50:46Z agurtovoy $
|
||||
// $Date: 2008-10-10 23:50:46 -0700 (Fri, 10 Oct 2008) $
|
||||
// $Revision: 49272 $
|
||||
|
||||
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
|
||||
# include <boost/mpl/aux_/arity.hpp>
|
||||
# include <boost/mpl/aux_/has_apply.hpp>
|
||||
# include <boost/mpl/aux_/na.hpp>
|
||||
# include <boost/mpl/aux_/msvc_never_true.hpp>
|
||||
#endif
|
||||
|
||||
#include <boost/mpl/aux_/config/use_preprocessed.hpp>
|
||||
|
||||
#if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \
|
||||
&& !defined(BOOST_MPL_PREPROCESSING_MODE)
|
||||
|
||||
# define BOOST_MPL_PREPROCESSED_HEADER apply_wrap.hpp
|
||||
# include <boost/mpl/aux_/include_preprocessed.hpp>
|
||||
|
||||
#else
|
||||
|
||||
# include <boost/mpl/limits/arity.hpp>
|
||||
# include <boost/mpl/aux_/preprocessor/params.hpp>
|
||||
# include <boost/mpl/aux_/preprocessor/enum.hpp>
|
||||
# include <boost/mpl/aux_/preprocessor/add.hpp>
|
||||
# include <boost/mpl/aux_/config/bcc.hpp>
|
||||
# include <boost/mpl/aux_/config/ctps.hpp>
|
||||
# include <boost/mpl/aux_/config/dtp.hpp>
|
||||
# include <boost/mpl/aux_/config/eti.hpp>
|
||||
# include <boost/mpl/aux_/config/msvc.hpp>
|
||||
# include <boost/mpl/aux_/config/workaround.hpp>
|
||||
|
||||
# include <boost/preprocessor/comma_if.hpp>
|
||||
# include <boost/preprocessor/logical/and.hpp>
|
||||
# include <boost/preprocessor/inc.hpp>
|
||||
# include <boost/preprocessor/iterate.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace mpl {
|
||||
|
||||
// local macros, #undef-ined at the end of the header
|
||||
# define AUX778076_APPLY_WRAP_PARAMS(n, param) \
|
||||
BOOST_MPL_PP_PARAMS(n, param) \
|
||||
/**/
|
||||
|
||||
# define AUX778076_APPLY_WRAP_SPEC_PARAMS(n, param) \
|
||||
BOOST_MPL_PP_ENUM(BOOST_PP_INC(n), param) \
|
||||
/**/
|
||||
|
||||
|
||||
#define BOOST_PP_ITERATION_PARAMS_1 \
|
||||
(3,(0, BOOST_MPL_LIMIT_METAFUNCTION_ARITY, <boost/mpl/apply_wrap.hpp>))
|
||||
#include BOOST_PP_ITERATE()
|
||||
|
||||
|
||||
# undef AUX778076_APPLY_WRAP_SPEC_PARAMS
|
||||
# undef AUX778076_APPLY_WRAP_PARAMS
|
||||
|
||||
}}
|
||||
|
||||
#endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
|
||||
#endif // BOOST_MPL_APPLY_WRAP_HPP_INCLUDED
|
||||
|
||||
///// iteration, depth == 1
|
||||
|
||||
// For gcc 4.4 compatability, we must include the
|
||||
// BOOST_PP_ITERATION_DEPTH test inside an #else clause.
|
||||
#else // BOOST_PP_IS_ITERATING
|
||||
#if BOOST_PP_ITERATION_DEPTH() == 1
|
||||
|
||||
# define i_ BOOST_PP_FRAME_ITERATION(1)
|
||||
|
||||
# if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
||||
// MSVC version
|
||||
|
||||
#define AUX778076_MSVC_DTW_NAME BOOST_PP_CAT(msvc_apply,i_)
|
||||
#define AUX778076_MSVC_DTW_ORIGINAL_NAME apply
|
||||
#define AUX778076_MSVC_DTW_ARITY i_
|
||||
#include <boost/mpl/aux_/msvc_dtw.hpp>
|
||||
|
||||
template<
|
||||
typename F BOOST_PP_COMMA_IF(i_) AUX778076_APPLY_WRAP_PARAMS(i_, typename T)
|
||||
>
|
||||
struct BOOST_PP_CAT(apply_wrap,i_)
|
||||
{
|
||||
// Metafunction forwarding confuses vc6
|
||||
typedef typename BOOST_PP_CAT(msvc_apply,i_)<F>::template result_<
|
||||
AUX778076_APPLY_WRAP_PARAMS(i_, T)
|
||||
>::type type;
|
||||
};
|
||||
|
||||
# elif defined(BOOST_MPL_CFG_BROKEN_DEFAULT_PARAMETERS_IN_NESTED_TEMPLATES)
|
||||
// MWCW/Borland version
|
||||
|
||||
template<
|
||||
int N, typename F BOOST_PP_COMMA_IF(i_) AUX778076_APPLY_WRAP_PARAMS(i_, typename T)
|
||||
>
|
||||
struct BOOST_PP_CAT(apply_wrap_impl,i_);
|
||||
|
||||
#define BOOST_PP_ITERATION_PARAMS_2 \
|
||||
(3,(0, BOOST_MPL_LIMIT_METAFUNCTION_ARITY - i_, <boost/mpl/apply_wrap.hpp>))
|
||||
#include BOOST_PP_ITERATE()
|
||||
|
||||
template<
|
||||
typename F BOOST_PP_COMMA_IF(i_) AUX778076_APPLY_WRAP_PARAMS(i_, typename T)
|
||||
>
|
||||
struct BOOST_PP_CAT(apply_wrap,i_)
|
||||
: BOOST_PP_CAT(apply_wrap_impl,i_)<
|
||||
::boost::mpl::aux::arity<F,i_>::value
|
||||
, F
|
||||
BOOST_PP_COMMA_IF(i_) AUX778076_APPLY_WRAP_PARAMS(i_, T)
|
||||
>::type
|
||||
{
|
||||
};
|
||||
|
||||
# else
|
||||
// ISO98 C++, with minor concession to vc7
|
||||
|
||||
template<
|
||||
typename F BOOST_PP_COMMA_IF(i_) AUX778076_APPLY_WRAP_PARAMS(i_, typename T)
|
||||
#if i_ == 0
|
||||
, typename has_apply_ = typename aux::has_apply<F>::type
|
||||
#endif
|
||||
>
|
||||
struct BOOST_PP_CAT(apply_wrap,i_)
|
||||
// metafunction forwarding confuses MSVC 7.0
|
||||
#if !BOOST_WORKAROUND(BOOST_MSVC, == 1300)
|
||||
: F::template apply< AUX778076_APPLY_WRAP_PARAMS(i_, T) >
|
||||
{
|
||||
#else
|
||||
{
|
||||
typedef typename F::template apply<
|
||||
AUX778076_APPLY_WRAP_PARAMS(i_, T)
|
||||
>::type type;
|
||||
#endif
|
||||
};
|
||||
|
||||
#if i_ == 0 && !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
||||
template< typename F >
|
||||
struct BOOST_PP_CAT(apply_wrap,i_)<F,true_>
|
||||
: F::apply
|
||||
{
|
||||
};
|
||||
#endif
|
||||
|
||||
# endif // workarounds
|
||||
|
||||
#if defined(BOOST_MPL_CFG_MSVC_ETI_BUG)
|
||||
/// workaround for ETI bug
|
||||
template<>
|
||||
struct BOOST_PP_CAT(apply_wrap,i_)<AUX778076_APPLY_WRAP_SPEC_PARAMS(i_, int)>
|
||||
{
|
||||
typedef int type;
|
||||
};
|
||||
#endif
|
||||
|
||||
# undef i_
|
||||
|
||||
///// iteration, depth == 2
|
||||
|
||||
#else if BOOST_PP_ITERATION_DEPTH() == 2
|
||||
|
||||
# define j_ BOOST_PP_FRAME_ITERATION(2)
|
||||
|
||||
#if i_ == 0 && j_ == 0 \
|
||||
&& defined(BOOST_MPL_CFG_BCC590_WORKAROUNDS) \
|
||||
&& !defined(BOOST_MPL_CFG_NO_HAS_APPLY)
|
||||
|
||||
template< typename F, bool F_has_apply >
|
||||
struct apply_wrap_impl0_bcb {
|
||||
typedef typename F::template apply< na > type;
|
||||
};
|
||||
|
||||
template< typename F >
|
||||
struct apply_wrap_impl0_bcb< F, true > {
|
||||
typedef typename F::apply type;
|
||||
};
|
||||
|
||||
template<
|
||||
typename F BOOST_PP_COMMA_IF(i_) AUX778076_APPLY_WRAP_PARAMS(i_, typename T)
|
||||
>
|
||||
struct BOOST_PP_CAT(apply_wrap_impl,i_)<
|
||||
BOOST_MPL_PP_ADD(i_, j_)
|
||||
, F
|
||||
BOOST_PP_COMMA_IF(i_) AUX778076_APPLY_WRAP_PARAMS(i_, T)
|
||||
>
|
||||
{
|
||||
typedef apply_wrap_impl0_bcb< F, aux::has_apply< F >::value >::type type;
|
||||
};
|
||||
#else
|
||||
|
||||
template<
|
||||
typename F BOOST_PP_COMMA_IF(i_) AUX778076_APPLY_WRAP_PARAMS(i_, typename T)
|
||||
>
|
||||
struct BOOST_PP_CAT(apply_wrap_impl,i_)<
|
||||
BOOST_MPL_PP_ADD(i_, j_)
|
||||
, F
|
||||
BOOST_PP_COMMA_IF(i_) AUX778076_APPLY_WRAP_PARAMS(i_, T)
|
||||
>
|
||||
{
|
||||
typedef typename F::template apply<
|
||||
AUX778076_APPLY_WRAP_PARAMS(i_, T)
|
||||
#if i_ == 0 && j_ == 0
|
||||
/// since the defaults are "lost", we have to pass *something* even for nullary
|
||||
/// metafunction classes
|
||||
na
|
||||
#else
|
||||
BOOST_PP_COMMA_IF(BOOST_PP_AND(i_, j_)) BOOST_MPL_PP_ENUM(j_, na)
|
||||
#endif
|
||||
> type;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
# undef j_
|
||||
|
||||
#endif // BOOST_PP_ITERATION_DEPTH()
|
||||
#endif // BOOST_PP_IS_ITERATING
|
||||
|
|
|
@ -1,128 +1,128 @@
|
|||
|
||||
#if !defined(BOOST_PP_IS_ITERATING)
|
||||
|
||||
///// header body
|
||||
|
||||
#ifndef BOOST_MPL_AUX778076_ADVANCE_BACKWARD_HPP_INCLUDED
|
||||
#define BOOST_MPL_AUX778076_ADVANCE_BACKWARD_HPP_INCLUDED
|
||||
|
||||
// Copyright Aleksey Gurtovoy 2000-2004
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// See http://www.boost.org/libs/mpl for documentation.
|
||||
|
||||
// $Id: advance_backward.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
|
||||
// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
|
||||
// $Revision: 49267 $
|
||||
|
||||
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
|
||||
# include <boost/mpl/prior.hpp>
|
||||
# include <boost/mpl/apply_wrap.hpp>
|
||||
#endif
|
||||
|
||||
#include <boost/mpl/aux_/config/use_preprocessed.hpp>
|
||||
|
||||
#if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \
|
||||
&& !defined(BOOST_MPL_PREPROCESSING_MODE)
|
||||
|
||||
# define BOOST_MPL_PREPROCESSED_HEADER advance_backward.hpp
|
||||
# include <boost/mpl/aux_/include_preprocessed.hpp>
|
||||
|
||||
#else
|
||||
|
||||
# include <boost/mpl/limits/unrolling.hpp>
|
||||
# include <boost/mpl/aux_/nttp_decl.hpp>
|
||||
# include <boost/mpl/aux_/config/eti.hpp>
|
||||
|
||||
# include <boost/preprocessor/iterate.hpp>
|
||||
# include <boost/preprocessor/cat.hpp>
|
||||
# include <boost/preprocessor/inc.hpp>
|
||||
|
||||
namespace boost { namespace mpl { namespace aux {
|
||||
|
||||
// forward declaration
|
||||
template< BOOST_MPL_AUX_NTTP_DECL(long, N) > struct advance_backward;
|
||||
|
||||
# define BOOST_PP_ITERATION_PARAMS_1 \
|
||||
(3,(0, BOOST_MPL_LIMIT_UNROLLING, <boost/mpl/aux_/advance_backward.hpp>))
|
||||
# include BOOST_PP_ITERATE()
|
||||
|
||||
// implementation for N that exceeds BOOST_MPL_LIMIT_UNROLLING
|
||||
template< BOOST_MPL_AUX_NTTP_DECL(long, N) >
|
||||
struct advance_backward
|
||||
{
|
||||
template< typename Iterator > struct apply
|
||||
{
|
||||
typedef typename apply_wrap1<
|
||||
advance_backward<BOOST_MPL_LIMIT_UNROLLING>
|
||||
, Iterator
|
||||
>::type chunk_result_;
|
||||
|
||||
typedef typename apply_wrap1<
|
||||
advance_backward<(
|
||||
(N - BOOST_MPL_LIMIT_UNROLLING) < 0
|
||||
? 0
|
||||
: N - BOOST_MPL_LIMIT_UNROLLING
|
||||
)>
|
||||
, chunk_result_
|
||||
>::type type;
|
||||
};
|
||||
};
|
||||
|
||||
}}}
|
||||
|
||||
#endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
|
||||
#endif // BOOST_MPL_AUX778076_ADVANCE_BACKWARD_HPP_INCLUDED
|
||||
|
||||
///// iteration, depth == 1
|
||||
|
||||
// For gcc 4.4 compatability, we must include the
|
||||
// BOOST_PP_ITERATION_DEPTH test inside an #else clause.
|
||||
#else // BOOST_PP_IS_ITERATING
|
||||
#if BOOST_PP_ITERATION_DEPTH() == 1
|
||||
#define i_ BOOST_PP_FRAME_ITERATION(1)
|
||||
|
||||
template<>
|
||||
struct advance_backward< BOOST_PP_FRAME_ITERATION(1) >
|
||||
{
|
||||
template< typename Iterator > struct apply
|
||||
{
|
||||
typedef Iterator iter0;
|
||||
|
||||
#if i_ > 0
|
||||
# define BOOST_PP_ITERATION_PARAMS_2 \
|
||||
(3,(1, BOOST_PP_FRAME_ITERATION(1), <boost/mpl/aux_/advance_backward.hpp>))
|
||||
# include BOOST_PP_ITERATE()
|
||||
#endif
|
||||
|
||||
typedef BOOST_PP_CAT(iter,BOOST_PP_FRAME_ITERATION(1)) type;
|
||||
};
|
||||
|
||||
#if defined(BOOST_MPL_CFG_MSVC_60_ETI_BUG)
|
||||
/// ETI workaround
|
||||
template<> struct apply<int>
|
||||
{
|
||||
typedef int type;
|
||||
};
|
||||
#endif
|
||||
};
|
||||
|
||||
#undef i_
|
||||
|
||||
///// iteration, depth == 2
|
||||
|
||||
#elif BOOST_PP_ITERATION_DEPTH() == 2
|
||||
|
||||
# define AUX778076_ITER_0 BOOST_PP_CAT(iter,BOOST_PP_DEC(BOOST_PP_FRAME_ITERATION(2)))
|
||||
# define AUX778076_ITER_1 BOOST_PP_CAT(iter,BOOST_PP_FRAME_ITERATION(2))
|
||||
|
||||
typedef typename prior<AUX778076_ITER_0>::type AUX778076_ITER_1;
|
||||
|
||||
# undef AUX778076_ITER_1
|
||||
# undef AUX778076_ITER_0
|
||||
|
||||
#endif // BOOST_PP_ITERATION_DEPTH()
|
||||
#endif // BOOST_PP_IS_ITERATING
|
||||
|
||||
#if !defined(BOOST_PP_IS_ITERATING)
|
||||
|
||||
///// header body
|
||||
|
||||
#ifndef BOOST_MPL_AUX778076_ADVANCE_BACKWARD_HPP_INCLUDED
|
||||
#define BOOST_MPL_AUX778076_ADVANCE_BACKWARD_HPP_INCLUDED
|
||||
|
||||
// Copyright Aleksey Gurtovoy 2000-2004
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// See http://www.boost.org/libs/mpl for documentation.
|
||||
|
||||
// $Id: advance_backward.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
|
||||
// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
|
||||
// $Revision: 49267 $
|
||||
|
||||
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
|
||||
# include <boost/mpl/prior.hpp>
|
||||
# include <boost/mpl/apply_wrap.hpp>
|
||||
#endif
|
||||
|
||||
#include <boost/mpl/aux_/config/use_preprocessed.hpp>
|
||||
|
||||
#if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \
|
||||
&& !defined(BOOST_MPL_PREPROCESSING_MODE)
|
||||
|
||||
# define BOOST_MPL_PREPROCESSED_HEADER advance_backward.hpp
|
||||
# include <boost/mpl/aux_/include_preprocessed.hpp>
|
||||
|
||||
#else
|
||||
|
||||
# include <boost/mpl/limits/unrolling.hpp>
|
||||
# include <boost/mpl/aux_/nttp_decl.hpp>
|
||||
# include <boost/mpl/aux_/config/eti.hpp>
|
||||
|
||||
# include <boost/preprocessor/iterate.hpp>
|
||||
# include <boost/preprocessor/cat.hpp>
|
||||
# include <boost/preprocessor/inc.hpp>
|
||||
|
||||
namespace boost { namespace mpl { namespace aux {
|
||||
|
||||
// forward declaration
|
||||
template< BOOST_MPL_AUX_NTTP_DECL(long, N) > struct advance_backward;
|
||||
|
||||
# define BOOST_PP_ITERATION_PARAMS_1 \
|
||||
(3,(0, BOOST_MPL_LIMIT_UNROLLING, <boost/mpl/aux_/advance_backward.hpp>))
|
||||
# include BOOST_PP_ITERATE()
|
||||
|
||||
// implementation for N that exceeds BOOST_MPL_LIMIT_UNROLLING
|
||||
template< BOOST_MPL_AUX_NTTP_DECL(long, N) >
|
||||
struct advance_backward
|
||||
{
|
||||
template< typename Iterator > struct apply
|
||||
{
|
||||
typedef typename apply_wrap1<
|
||||
advance_backward<BOOST_MPL_LIMIT_UNROLLING>
|
||||
, Iterator
|
||||
>::type chunk_result_;
|
||||
|
||||
typedef typename apply_wrap1<
|
||||
advance_backward<(
|
||||
(N - BOOST_MPL_LIMIT_UNROLLING) < 0
|
||||
? 0
|
||||
: N - BOOST_MPL_LIMIT_UNROLLING
|
||||
)>
|
||||
, chunk_result_
|
||||
>::type type;
|
||||
};
|
||||
};
|
||||
|
||||
}}}
|
||||
|
||||
#endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
|
||||
#endif // BOOST_MPL_AUX778076_ADVANCE_BACKWARD_HPP_INCLUDED
|
||||
|
||||
///// iteration, depth == 1
|
||||
|
||||
// For gcc 4.4 compatability, we must include the
|
||||
// BOOST_PP_ITERATION_DEPTH test inside an #else clause.
|
||||
#else // BOOST_PP_IS_ITERATING
|
||||
#if BOOST_PP_ITERATION_DEPTH() == 1
|
||||
#define i_ BOOST_PP_FRAME_ITERATION(1)
|
||||
|
||||
template<>
|
||||
struct advance_backward< BOOST_PP_FRAME_ITERATION(1) >
|
||||
{
|
||||
template< typename Iterator > struct apply
|
||||
{
|
||||
typedef Iterator iter0;
|
||||
|
||||
#if i_ > 0
|
||||
# define BOOST_PP_ITERATION_PARAMS_2 \
|
||||
(3,(1, BOOST_PP_FRAME_ITERATION(1), <boost/mpl/aux_/advance_backward.hpp>))
|
||||
# include BOOST_PP_ITERATE()
|
||||
#endif
|
||||
|
||||
typedef BOOST_PP_CAT(iter,BOOST_PP_FRAME_ITERATION(1)) type;
|
||||
};
|
||||
|
||||
#if defined(BOOST_MPL_CFG_MSVC_60_ETI_BUG)
|
||||
/// ETI workaround
|
||||
template<> struct apply<int>
|
||||
{
|
||||
typedef int type;
|
||||
};
|
||||
#endif
|
||||
};
|
||||
|
||||
#undef i_
|
||||
|
||||
///// iteration, depth == 2
|
||||
|
||||
#else if BOOST_PP_ITERATION_DEPTH() == 2
|
||||
|
||||
# define AUX778076_ITER_0 BOOST_PP_CAT(iter,BOOST_PP_DEC(BOOST_PP_FRAME_ITERATION(2)))
|
||||
# define AUX778076_ITER_1 BOOST_PP_CAT(iter,BOOST_PP_FRAME_ITERATION(2))
|
||||
|
||||
typedef typename prior<AUX778076_ITER_0>::type AUX778076_ITER_1;
|
||||
|
||||
# undef AUX778076_ITER_1
|
||||
# undef AUX778076_ITER_0
|
||||
|
||||
#endif // BOOST_PP_ITERATION_DEPTH()
|
||||
#endif // BOOST_PP_IS_ITERATING
|
||||
|
|
254
mp/src/thirdparty/boost/mpl/aux_/advance_forward.hpp
vendored
254
mp/src/thirdparty/boost/mpl/aux_/advance_forward.hpp
vendored
|
@ -1,127 +1,127 @@
|
|||
|
||||
#if !defined(BOOST_PP_IS_ITERATING)
|
||||
|
||||
///// header body
|
||||
|
||||
#ifndef BOOST_MPL_AUX_ADVANCE_FORWARD_HPP_INCLUDED
|
||||
#define BOOST_MPL_AUX_ADVANCE_FORWARD_HPP_INCLUDED
|
||||
|
||||
// Copyright Aleksey Gurtovoy 2000-2004
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// See http://www.boost.org/libs/mpl for documentation.
|
||||
|
||||
// $Id: advance_forward.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
|
||||
// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
|
||||
// $Revision: 49267 $
|
||||
|
||||
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
|
||||
# include <boost/mpl/next.hpp>
|
||||
# include <boost/mpl/apply_wrap.hpp>
|
||||
#endif
|
||||
|
||||
#include <boost/mpl/aux_/config/use_preprocessed.hpp>
|
||||
|
||||
#if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \
|
||||
&& !defined(BOOST_MPL_PREPROCESSING_MODE)
|
||||
|
||||
# define BOOST_MPL_PREPROCESSED_HEADER advance_forward.hpp
|
||||
# include <boost/mpl/aux_/include_preprocessed.hpp>
|
||||
|
||||
#else
|
||||
|
||||
# include <boost/mpl/limits/unrolling.hpp>
|
||||
# include <boost/mpl/aux_/nttp_decl.hpp>
|
||||
# include <boost/mpl/aux_/config/eti.hpp>
|
||||
|
||||
# include <boost/preprocessor/iterate.hpp>
|
||||
# include <boost/preprocessor/cat.hpp>
|
||||
# include <boost/preprocessor/inc.hpp>
|
||||
|
||||
namespace boost { namespace mpl { namespace aux {
|
||||
|
||||
// forward declaration
|
||||
template< BOOST_MPL_AUX_NTTP_DECL(long, N) > struct advance_forward;
|
||||
|
||||
# define BOOST_PP_ITERATION_PARAMS_1 \
|
||||
(3,(0, BOOST_MPL_LIMIT_UNROLLING, <boost/mpl/aux_/advance_forward.hpp>))
|
||||
# include BOOST_PP_ITERATE()
|
||||
|
||||
// implementation for N that exceeds BOOST_MPL_LIMIT_UNROLLING
|
||||
template< BOOST_MPL_AUX_NTTP_DECL(long, N) >
|
||||
struct advance_forward
|
||||
{
|
||||
template< typename Iterator > struct apply
|
||||
{
|
||||
typedef typename apply_wrap1<
|
||||
advance_forward<BOOST_MPL_LIMIT_UNROLLING>
|
||||
, Iterator
|
||||
>::type chunk_result_;
|
||||
|
||||
typedef typename apply_wrap1<
|
||||
advance_forward<(
|
||||
(N - BOOST_MPL_LIMIT_UNROLLING) < 0
|
||||
? 0
|
||||
: N - BOOST_MPL_LIMIT_UNROLLING
|
||||
)>
|
||||
, chunk_result_
|
||||
>::type type;
|
||||
};
|
||||
};
|
||||
|
||||
}}}
|
||||
|
||||
#endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
|
||||
#endif // BOOST_MPL_AUX_ADVANCE_FORWARD_HPP_INCLUDED
|
||||
|
||||
///// iteration, depth == 1
|
||||
|
||||
// For gcc 4.4 compatability, we must include the
|
||||
// BOOST_PP_ITERATION_DEPTH test inside an #else clause.
|
||||
#else // BOOST_PP_IS_ITERATING
|
||||
#if BOOST_PP_ITERATION_DEPTH() == 1
|
||||
#define i_ BOOST_PP_FRAME_ITERATION(1)
|
||||
|
||||
template<>
|
||||
struct advance_forward< BOOST_PP_FRAME_ITERATION(1) >
|
||||
{
|
||||
template< typename Iterator > struct apply
|
||||
{
|
||||
typedef Iterator iter0;
|
||||
|
||||
#if i_ > 0
|
||||
# define BOOST_PP_ITERATION_PARAMS_2 \
|
||||
(3,(1, i_, <boost/mpl/aux_/advance_forward.hpp>))
|
||||
# include BOOST_PP_ITERATE()
|
||||
#endif
|
||||
typedef BOOST_PP_CAT(iter,i_) type;
|
||||
};
|
||||
|
||||
#if defined(BOOST_MPL_CFG_MSVC_60_ETI_BUG)
|
||||
/// ETI workaround
|
||||
template<> struct apply<int>
|
||||
{
|
||||
typedef int type;
|
||||
};
|
||||
#endif
|
||||
};
|
||||
|
||||
#undef i_
|
||||
|
||||
///// iteration, depth == 2
|
||||
|
||||
#elif BOOST_PP_ITERATION_DEPTH() == 2
|
||||
|
||||
# define AUX778076_ITER_0 BOOST_PP_CAT(iter,BOOST_PP_DEC(BOOST_PP_FRAME_ITERATION(2)))
|
||||
# define AUX778076_ITER_1 BOOST_PP_CAT(iter,BOOST_PP_FRAME_ITERATION(2))
|
||||
|
||||
typedef typename next<AUX778076_ITER_0>::type AUX778076_ITER_1;
|
||||
|
||||
# undef AUX778076_ITER_1
|
||||
# undef AUX778076_ITER_0
|
||||
|
||||
#endif // BOOST_PP_ITERATION_DEPTH()
|
||||
#endif // BOOST_PP_IS_ITERATING
|
||||
|
||||
#if !defined(BOOST_PP_IS_ITERATING)
|
||||
|
||||
///// header body
|
||||
|
||||
#ifndef BOOST_MPL_AUX_ADVANCE_FORWARD_HPP_INCLUDED
|
||||
#define BOOST_MPL_AUX_ADVANCE_FORWARD_HPP_INCLUDED
|
||||
|
||||
// Copyright Aleksey Gurtovoy 2000-2004
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// See http://www.boost.org/libs/mpl for documentation.
|
||||
|
||||
// $Id: advance_forward.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
|
||||
// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
|
||||
// $Revision: 49267 $
|
||||
|
||||
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
|
||||
# include <boost/mpl/next.hpp>
|
||||
# include <boost/mpl/apply_wrap.hpp>
|
||||
#endif
|
||||
|
||||
#include <boost/mpl/aux_/config/use_preprocessed.hpp>
|
||||
|
||||
#if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \
|
||||
&& !defined(BOOST_MPL_PREPROCESSING_MODE)
|
||||
|
||||
# define BOOST_MPL_PREPROCESSED_HEADER advance_forward.hpp
|
||||
# include <boost/mpl/aux_/include_preprocessed.hpp>
|
||||
|
||||
#else
|
||||
|
||||
# include <boost/mpl/limits/unrolling.hpp>
|
||||
# include <boost/mpl/aux_/nttp_decl.hpp>
|
||||
# include <boost/mpl/aux_/config/eti.hpp>
|
||||
|
||||
# include <boost/preprocessor/iterate.hpp>
|
||||
# include <boost/preprocessor/cat.hpp>
|
||||
# include <boost/preprocessor/inc.hpp>
|
||||
|
||||
namespace boost { namespace mpl { namespace aux {
|
||||
|
||||
// forward declaration
|
||||
template< BOOST_MPL_AUX_NTTP_DECL(long, N) > struct advance_forward;
|
||||
|
||||
# define BOOST_PP_ITERATION_PARAMS_1 \
|
||||
(3,(0, BOOST_MPL_LIMIT_UNROLLING, <boost/mpl/aux_/advance_forward.hpp>))
|
||||
# include BOOST_PP_ITERATE()
|
||||
|
||||
// implementation for N that exceeds BOOST_MPL_LIMIT_UNROLLING
|
||||
template< BOOST_MPL_AUX_NTTP_DECL(long, N) >
|
||||
struct advance_forward
|
||||
{
|
||||
template< typename Iterator > struct apply
|
||||
{
|
||||
typedef typename apply_wrap1<
|
||||
advance_forward<BOOST_MPL_LIMIT_UNROLLING>
|
||||
, Iterator
|
||||
>::type chunk_result_;
|
||||
|
||||
typedef typename apply_wrap1<
|
||||
advance_forward<(
|
||||
(N - BOOST_MPL_LIMIT_UNROLLING) < 0
|
||||
? 0
|
||||
: N - BOOST_MPL_LIMIT_UNROLLING
|
||||
)>
|
||||
, chunk_result_
|
||||
>::type type;
|
||||
};
|
||||
};
|
||||
|
||||
}}}
|
||||
|
||||
#endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
|
||||
#endif // BOOST_MPL_AUX_ADVANCE_FORWARD_HPP_INCLUDED
|
||||
|
||||
///// iteration, depth == 1
|
||||
|
||||
// For gcc 4.4 compatability, we must include the
|
||||
// BOOST_PP_ITERATION_DEPTH test inside an #else clause.
|
||||
#else // BOOST_PP_IS_ITERATING
|
||||
#if BOOST_PP_ITERATION_DEPTH() == 1
|
||||
#define i_ BOOST_PP_FRAME_ITERATION(1)
|
||||
|
||||
template<>
|
||||
struct advance_forward< BOOST_PP_FRAME_ITERATION(1) >
|
||||
{
|
||||
template< typename Iterator > struct apply
|
||||
{
|
||||
typedef Iterator iter0;
|
||||
|
||||
#if i_ > 0
|
||||
# define BOOST_PP_ITERATION_PARAMS_2 \
|
||||
(3,(1, i_, <boost/mpl/aux_/advance_forward.hpp>))
|
||||
# include BOOST_PP_ITERATE()
|
||||
#endif
|
||||
typedef BOOST_PP_CAT(iter,i_) type;
|
||||
};
|
||||
|
||||
#if defined(BOOST_MPL_CFG_MSVC_60_ETI_BUG)
|
||||
/// ETI workaround
|
||||
template<> struct apply<int>
|
||||
{
|
||||
typedef int type;
|
||||
};
|
||||
#endif
|
||||
};
|
||||
|
||||
#undef i_
|
||||
|
||||
///// iteration, depth == 2
|
||||
|
||||
#else if BOOST_PP_ITERATION_DEPTH() == 2
|
||||
|
||||
# define AUX778076_ITER_0 BOOST_PP_CAT(iter,BOOST_PP_DEC(BOOST_PP_FRAME_ITERATION(2)))
|
||||
# define AUX778076_ITER_1 BOOST_PP_CAT(iter,BOOST_PP_FRAME_ITERATION(2))
|
||||
|
||||
typedef typename next<AUX778076_ITER_0>::type AUX778076_ITER_1;
|
||||
|
||||
# undef AUX778076_ITER_1
|
||||
# undef AUX778076_ITER_0
|
||||
|
||||
#endif // BOOST_PP_ITERATION_DEPTH()
|
||||
#endif // BOOST_PP_IS_ITERATING
|
||||
|
|
1102
mp/src/thirdparty/boost/mpl/bind.hpp
vendored
1102
mp/src/thirdparty/boost/mpl/bind.hpp
vendored
File diff suppressed because it is too large
Load diff
|
@ -1,138 +1,138 @@
|
|||
//
|
||||
//! Copyright (c) 2011-2012
|
||||
//! Brandon Kohn
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
#if !defined(BOOST_NUMERIC_CONVERSION_DONT_USE_PREPROCESSED_FILES)
|
||||
|
||||
#include <boost/numeric/conversion/detail/preprocessed/numeric_cast_traits_common.hpp>
|
||||
|
||||
#if !defined(BOOST_NO_LONG_LONG)
|
||||
#include <boost/numeric/conversion/detail/preprocessed/numeric_cast_traits_long_long.hpp>
|
||||
#endif
|
||||
|
||||
#else
|
||||
#if !BOOST_PP_IS_ITERATING
|
||||
|
||||
#include <boost/preprocessor/seq/elem.hpp>
|
||||
#include <boost/preprocessor/seq/size.hpp>
|
||||
#include <boost/preprocessor/iteration/iterate.hpp>
|
||||
|
||||
#if defined(__WAVE__) && defined(BOOST_NUMERIC_CONVERSION_CREATE_PREPROCESSED_FILES)
|
||||
#pragma wave option(preserve: 2, line: 0, output: "preprocessed/numeric_cast_traits_common.hpp")
|
||||
#endif
|
||||
//
|
||||
//! Copyright (c) 2011-2012
|
||||
//! Brandon Kohn
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#if defined(__WAVE__) && defined(BOOST_NUMERIC_CONVERSION_CREATE_PREPROCESSED_FILES)
|
||||
#pragma wave option(preserve: 1)
|
||||
#endif
|
||||
|
||||
//! These are the assumed common built in fundamental types (not typedefs/macros.)
|
||||
#define BOOST_NUMERIC_CONVERSION_BASE_BUILTIN_TYPES() \
|
||||
(char) \
|
||||
(signed char) \
|
||||
(unsigned char) \
|
||||
(short) \
|
||||
(unsigned short) \
|
||||
(int) \
|
||||
(unsigned int) \
|
||||
(long) \
|
||||
(unsigned long) \
|
||||
(float) \
|
||||
(double) \
|
||||
(long double) \
|
||||
/***/
|
||||
|
||||
#define BOOST_NUMERIC_CONVERSION_SEQ_A() BOOST_NUMERIC_CONVERSION_BASE_BUILTIN_TYPES()
|
||||
#define BOOST_NUMERIC_CONVERSION_SEQ_B() BOOST_NUMERIC_CONVERSION_BASE_BUILTIN_TYPES()
|
||||
|
||||
namespace boost { namespace numeric {
|
||||
|
||||
#define BOOST_PP_ITERATION_PARAMS_1 (3, (0, BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(BOOST_NUMERIC_CONVERSION_SEQ_A())), <boost/numeric/conversion/detail/numeric_cast_traits.hpp>))
|
||||
#include BOOST_PP_ITERATE()
|
||||
|
||||
}}//namespace boost::numeric;
|
||||
|
||||
#if defined(__WAVE__) && defined(BOOST_NUMERIC_CONVERSION_CREATE_PREPROCESSED_FILES)
|
||||
#pragma wave option(output: null)
|
||||
#endif
|
||||
|
||||
#if ( defined(__WAVE__) && defined(BOOST_NUMERIC_CONVERSION_CREATE_PREPROCESSED_FILES) ) || !defined(BOOST_NO_LONG_LONG)
|
||||
|
||||
#undef BOOST_NUMERIC_CONVERSION_SEQ_A
|
||||
#undef BOOST_NUMERIC_CONVERSION_SEQ_B
|
||||
|
||||
#if defined(__WAVE__) && defined(BOOST_NUMERIC_CONVERSION_CREATE_PREPROCESSED_FILES)
|
||||
#pragma wave option(preserve: 2, line: 0, output: "preprocessed/numeric_cast_traits_long_long.hpp")
|
||||
#endif
|
||||
|
||||
//
|
||||
//! Copyright (c) 2011-2012
|
||||
//! Brandon Kohn
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#if defined(__WAVE__) && defined(BOOST_NUMERIC_CONVERSION_CREATE_PREPROCESSED_FILES)
|
||||
#pragma wave option(preserve: 1)
|
||||
#endif
|
||||
|
||||
namespace boost { namespace numeric {
|
||||
|
||||
#define BOOST_NUMERIC_CONVERSION_SEQ_A() BOOST_NUMERIC_CONVERSION_BASE_BUILTIN_TYPES()(boost::long_long_type)(boost::ulong_long_type)
|
||||
#define BOOST_NUMERIC_CONVERSION_SEQ_B() (boost::long_long_type)(boost::ulong_long_type)
|
||||
|
||||
#define BOOST_PP_ITERATION_PARAMS_1 (3, (0, BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(BOOST_NUMERIC_CONVERSION_SEQ_A())), <boost/numeric/conversion/detail/numeric_cast_traits.hpp>))
|
||||
#include BOOST_PP_ITERATE()
|
||||
|
||||
}}//namespace boost::numeric;
|
||||
|
||||
#if defined(__WAVE__) && defined(BOOST_NUMERIC_CONVERSION_CREATE_PREPROCESSED_FILES)
|
||||
#pragma wave option(output: null)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#undef BOOST_NUMERIC_CONVERSION_BASE_BUILTIN_TYPES
|
||||
#undef BOOST_NUMERIC_CONVERSION_SEQ_A
|
||||
#undef BOOST_NUMERIC_CONVERSION_SEQ_B
|
||||
|
||||
#elif BOOST_PP_ITERATION_DEPTH() == 1
|
||||
|
||||
#define BOOST_PP_ITERATION_PARAMS_2 (3, (0, BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(BOOST_NUMERIC_CONVERSION_SEQ_B())), <boost/numeric/conversion/detail/numeric_cast_traits.hpp>))
|
||||
#include BOOST_PP_ITERATE()
|
||||
|
||||
#elif BOOST_PP_ITERATION_DEPTH() == 2
|
||||
|
||||
//! Generate default traits for the specified source and target.
|
||||
#define BOOST_NUMERIC_CONVERSION_A BOOST_PP_FRAME_ITERATION(1)
|
||||
#define BOOST_NUMERIC_CONVERSION_B BOOST_PP_FRAME_ITERATION(2)
|
||||
|
||||
template <>
|
||||
struct numeric_cast_traits
|
||||
<
|
||||
BOOST_PP_SEQ_ELEM(BOOST_NUMERIC_CONVERSION_A, BOOST_NUMERIC_CONVERSION_SEQ_A())
|
||||
, BOOST_PP_SEQ_ELEM(BOOST_NUMERIC_CONVERSION_B, BOOST_NUMERIC_CONVERSION_SEQ_B())
|
||||
>
|
||||
{
|
||||
typedef def_overflow_handler overflow_policy;
|
||||
typedef UseInternalRangeChecker range_checking_policy;
|
||||
typedef Trunc<BOOST_PP_SEQ_ELEM(BOOST_NUMERIC_CONVERSION_B, BOOST_NUMERIC_CONVERSION_SEQ_B())> rounding_policy;
|
||||
};
|
||||
|
||||
#undef BOOST_NUMERIC_CONVERSION_A
|
||||
#undef BOOST_NUMERIC_CONVERSION_B
|
||||
|
||||
#endif//! Depth 2.
|
||||
#endif// BOOST_NUMERIC_CONVERSION_DONT_USE_PREPROCESSED_FILES
|
||||
//
|
||||
//! Copyright (c) 2011-2012
|
||||
//! Brandon Kohn
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
#if !defined(BOOST_NUMERIC_CONVERSION_DONT_USE_PREPROCESSED_FILES)
|
||||
|
||||
#include <boost/numeric/conversion/detail/preprocessed/numeric_cast_traits_common.hpp>
|
||||
|
||||
#if !defined(BOOST_NO_LONG_LONG)
|
||||
#include <boost/numeric/conversion/detail/preprocessed/numeric_cast_traits_long_long.hpp>
|
||||
#endif
|
||||
|
||||
#else
|
||||
#if !BOOST_PP_IS_ITERATING
|
||||
|
||||
#include <boost/preprocessor/seq/elem.hpp>
|
||||
#include <boost/preprocessor/seq/size.hpp>
|
||||
#include <boost/preprocessor/iteration/iterate.hpp>
|
||||
|
||||
#if defined(__WAVE__) && defined(BOOST_NUMERIC_CONVERSION_CREATE_PREPROCESSED_FILES)
|
||||
#pragma wave option(preserve: 2, line: 0, output: "preprocessed/numeric_cast_traits_common.hpp")
|
||||
#endif
|
||||
//
|
||||
//! Copyright (c) 2011-2012
|
||||
//! Brandon Kohn
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#if defined(__WAVE__) && defined(BOOST_NUMERIC_CONVERSION_CREATE_PREPROCESSED_FILES)
|
||||
#pragma wave option(preserve: 1)
|
||||
#endif
|
||||
|
||||
//! These are the assumed common built in fundamental types (not typedefs/macros.)
|
||||
#define BOOST_NUMERIC_CONVERSION_BASE_BUILTIN_TYPES() \
|
||||
(char) \
|
||||
(signed char) \
|
||||
(unsigned char) \
|
||||
(short) \
|
||||
(unsigned short) \
|
||||
(int) \
|
||||
(unsigned int) \
|
||||
(long) \
|
||||
(unsigned long) \
|
||||
(float) \
|
||||
(double) \
|
||||
(long double) \
|
||||
/***/
|
||||
|
||||
#define BOOST_NUMERIC_CONVERSION_SEQ_A() BOOST_NUMERIC_CONVERSION_BASE_BUILTIN_TYPES()
|
||||
#define BOOST_NUMERIC_CONVERSION_SEQ_B() BOOST_NUMERIC_CONVERSION_BASE_BUILTIN_TYPES()
|
||||
|
||||
namespace boost { namespace numeric {
|
||||
|
||||
#define BOOST_PP_ITERATION_PARAMS_1 (3, (0, BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(BOOST_NUMERIC_CONVERSION_SEQ_A())), <boost/numeric/conversion/detail/numeric_cast_traits.hpp>))
|
||||
#include BOOST_PP_ITERATE()
|
||||
|
||||
}}//namespace boost::numeric;
|
||||
|
||||
#if defined(__WAVE__) && defined(BOOST_NUMERIC_CONVERSION_CREATE_PREPROCESSED_FILES)
|
||||
#pragma wave option(output: null)
|
||||
#endif
|
||||
|
||||
#if ( defined(__WAVE__) && defined(BOOST_NUMERIC_CONVERSION_CREATE_PREPROCESSED_FILES) ) || !defined(BOOST_NO_LONG_LONG)
|
||||
|
||||
#undef BOOST_NUMERIC_CONVERSION_SEQ_A
|
||||
#undef BOOST_NUMERIC_CONVERSION_SEQ_B
|
||||
|
||||
#if defined(__WAVE__) && defined(BOOST_NUMERIC_CONVERSION_CREATE_PREPROCESSED_FILES)
|
||||
#pragma wave option(preserve: 2, line: 0, output: "preprocessed/numeric_cast_traits_long_long.hpp")
|
||||
#endif
|
||||
|
||||
//
|
||||
//! Copyright (c) 2011-2012
|
||||
//! Brandon Kohn
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#if defined(__WAVE__) && defined(BOOST_NUMERIC_CONVERSION_CREATE_PREPROCESSED_FILES)
|
||||
#pragma wave option(preserve: 1)
|
||||
#endif
|
||||
|
||||
namespace boost { namespace numeric {
|
||||
|
||||
#define BOOST_NUMERIC_CONVERSION_SEQ_A() BOOST_NUMERIC_CONVERSION_BASE_BUILTIN_TYPES()(boost::long_long_type)(boost::ulong_long_type)
|
||||
#define BOOST_NUMERIC_CONVERSION_SEQ_B() (boost::long_long_type)(boost::ulong_long_type)
|
||||
|
||||
#define BOOST_PP_ITERATION_PARAMS_1 (3, (0, BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(BOOST_NUMERIC_CONVERSION_SEQ_A())), <boost/numeric/conversion/detail/numeric_cast_traits.hpp>))
|
||||
#include BOOST_PP_ITERATE()
|
||||
|
||||
}}//namespace boost::numeric;
|
||||
|
||||
#if defined(__WAVE__) && defined(BOOST_NUMERIC_CONVERSION_CREATE_PREPROCESSED_FILES)
|
||||
#pragma wave option(output: null)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#undef BOOST_NUMERIC_CONVERSION_BASE_BUILTIN_TYPES
|
||||
#undef BOOST_NUMERIC_CONVERSION_SEQ_A
|
||||
#undef BOOST_NUMERIC_CONVERSION_SEQ_B
|
||||
|
||||
#else if BOOST_PP_ITERATION_DEPTH() == 1
|
||||
|
||||
#define BOOST_PP_ITERATION_PARAMS_2 (3, (0, BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(BOOST_NUMERIC_CONVERSION_SEQ_B())), <boost/numeric/conversion/detail/numeric_cast_traits.hpp>))
|
||||
#include BOOST_PP_ITERATE()
|
||||
|
||||
#else if BOOST_PP_ITERATION_DEPTH() == 2
|
||||
|
||||
//! Generate default traits for the specified source and target.
|
||||
#define BOOST_NUMERIC_CONVERSION_A BOOST_PP_FRAME_ITERATION(1)
|
||||
#define BOOST_NUMERIC_CONVERSION_B BOOST_PP_FRAME_ITERATION(2)
|
||||
|
||||
template <>
|
||||
struct numeric_cast_traits
|
||||
<
|
||||
BOOST_PP_SEQ_ELEM(BOOST_NUMERIC_CONVERSION_A, BOOST_NUMERIC_CONVERSION_SEQ_A())
|
||||
, BOOST_PP_SEQ_ELEM(BOOST_NUMERIC_CONVERSION_B, BOOST_NUMERIC_CONVERSION_SEQ_B())
|
||||
>
|
||||
{
|
||||
typedef def_overflow_handler overflow_policy;
|
||||
typedef UseInternalRangeChecker range_checking_policy;
|
||||
typedef Trunc<BOOST_PP_SEQ_ELEM(BOOST_NUMERIC_CONVERSION_B, BOOST_NUMERIC_CONVERSION_SEQ_B())> rounding_policy;
|
||||
};
|
||||
|
||||
#undef BOOST_NUMERIC_CONVERSION_A
|
||||
#undef BOOST_NUMERIC_CONVERSION_B
|
||||
|
||||
#endif//! Depth 2.
|
||||
#endif// BOOST_NUMERIC_CONVERSION_DONT_USE_PREPROCESSED_FILES
|
||||
|
|
|
@ -63,7 +63,7 @@ BOOST_PP_IF(N, A0, void)(* target(R (*)(BOOST_PP_ENUM_PARAMS_Z(1, N, A))) )()
|
|||
# define BOOST_PP_ITERATION_PARAMS_2 (3, (0, BOOST_PYTHON_MAX_ARITY, <boost/python/detail/target.hpp>))
|
||||
# include BOOST_PP_ITERATE()
|
||||
|
||||
#elif BOOST_PP_ITERATION_DEPTH() == 2
|
||||
#else if BOOST_PP_ITERATION_DEPTH() == 2
|
||||
# if !(BOOST_WORKAROUND(__MWERKS__, > 0x3100) \
|
||||
&& BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3201)))
|
||||
# line BOOST_PP_LINE(__LINE__, target.hpp(pointers-to-members))
|
||||
|
|
|
@ -1,101 +1,101 @@
|
|||
/*=============================================================================
|
||||
Copyright (c) 2005-2007 Dan Marsden
|
||||
Copyright (c) 2005-2007 Joel de Guzman
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#ifndef BOOST_PP_IS_ITERATING
|
||||
#ifndef PHOENIX_STATEMENT_DETAIL_CATCH_ALL_EVAL_HPP
|
||||
#define PHOENIX_STATEMENT_DETAIL_CATCH_ALL_EVAL_HPP
|
||||
|
||||
#include <boost/spirit/home/phoenix/core/limits.hpp>
|
||||
#include <boost/preprocessor/iteration/iterate.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params_with_defaults.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_binary_params.hpp>
|
||||
#include <boost/preprocessor/repetition/repeat.hpp>
|
||||
#include <boost/preprocessor/dec.hpp>
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
#include <boost/mpl/void.hpp>
|
||||
|
||||
namespace boost { namespace phoenix {
|
||||
class catch_all_eval
|
||||
{
|
||||
public:
|
||||
template<typename Env, typename TryBody,
|
||||
BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(PHOENIX_CATCH_LIMIT, typename CatchBody, mpl::void_),
|
||||
typename CatchAllBody = mpl::void_>
|
||||
struct result
|
||||
{
|
||||
typedef void type;
|
||||
};
|
||||
|
||||
template<typename Rt, typename Env, typename TryBody,
|
||||
typename CatchAllBody>
|
||||
static void eval(
|
||||
const Env& env, TryBody& tryBody, CatchAllBody& catchAllBody)
|
||||
{
|
||||
try
|
||||
{
|
||||
tryBody.eval(env);
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
catchAllBody.eval(env);
|
||||
}
|
||||
}
|
||||
|
||||
#define BOOST_PP_ITERATION_PARAMS_1 \
|
||||
(3, (1, PHOENIX_CATCH_LIMIT, "boost/spirit/home/phoenix/statement/detail/catch_all_eval.hpp"))
|
||||
|
||||
#include BOOST_PP_ITERATE()
|
||||
|
||||
};
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
||||
#elif BOOST_PP_ITERATION_DEPTH() == 1
|
||||
|
||||
#define PHOENIX_ITERATION BOOST_PP_ITERATION()
|
||||
|
||||
template<typename Rt, typename Env, typename TryBody,
|
||||
BOOST_PP_ENUM_PARAMS(PHOENIX_ITERATION, typename CatchBody),
|
||||
typename CatchAllBody>
|
||||
static void eval(
|
||||
const Env& env, TryBody& tryBody,
|
||||
BOOST_PP_ENUM_BINARY_PARAMS(PHOENIX_ITERATION, CatchBody, catchBody),
|
||||
CatchAllBody& catchAllBody)
|
||||
{
|
||||
try
|
||||
{
|
||||
tryBody.eval(env);
|
||||
}
|
||||
|
||||
#define BOOST_PP_ITERATION_PARAMS_2 \
|
||||
(3, (0, BOOST_PP_DEC(PHOENIX_ITERATION), "boost/spirit/home/phoenix/statement/detail/catch_all_eval.hpp"))
|
||||
|
||||
#include BOOST_PP_ITERATE()
|
||||
|
||||
catch(...)
|
||||
{
|
||||
catchAllBody.eval(env);
|
||||
}
|
||||
}
|
||||
|
||||
#undef PHOENIX_ITERATION
|
||||
|
||||
#elif BOOST_PP_ITERATION_DEPTH() == 2
|
||||
|
||||
#define PHOENIX_ITERATION BOOST_PP_ITERATION()
|
||||
|
||||
catch(typename BOOST_PP_CAT(CatchBody, PHOENIX_ITERATION)::exception_type&)
|
||||
{
|
||||
BOOST_PP_CAT(catchBody, PHOENIX_ITERATION).eval(env);
|
||||
}
|
||||
|
||||
#undef PHOENIX_ITERATION
|
||||
|
||||
#endif
|
||||
/*=============================================================================
|
||||
Copyright (c) 2005-2007 Dan Marsden
|
||||
Copyright (c) 2005-2007 Joel de Guzman
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#ifndef BOOST_PP_IS_ITERATING
|
||||
#ifndef PHOENIX_STATEMENT_DETAIL_CATCH_ALL_EVAL_HPP
|
||||
#define PHOENIX_STATEMENT_DETAIL_CATCH_ALL_EVAL_HPP
|
||||
|
||||
#include <boost/spirit/home/phoenix/core/limits.hpp>
|
||||
#include <boost/preprocessor/iteration/iterate.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params_with_defaults.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_binary_params.hpp>
|
||||
#include <boost/preprocessor/repetition/repeat.hpp>
|
||||
#include <boost/preprocessor/dec.hpp>
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
#include <boost/mpl/void.hpp>
|
||||
|
||||
namespace boost { namespace phoenix {
|
||||
class catch_all_eval
|
||||
{
|
||||
public:
|
||||
template<typename Env, typename TryBody,
|
||||
BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(PHOENIX_CATCH_LIMIT, typename CatchBody, mpl::void_),
|
||||
typename CatchAllBody = mpl::void_>
|
||||
struct result
|
||||
{
|
||||
typedef void type;
|
||||
};
|
||||
|
||||
template<typename Rt, typename Env, typename TryBody,
|
||||
typename CatchAllBody>
|
||||
static void eval(
|
||||
const Env& env, TryBody& tryBody, CatchAllBody& catchAllBody)
|
||||
{
|
||||
try
|
||||
{
|
||||
tryBody.eval(env);
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
catchAllBody.eval(env);
|
||||
}
|
||||
}
|
||||
|
||||
#define BOOST_PP_ITERATION_PARAMS_1 \
|
||||
(3, (1, PHOENIX_CATCH_LIMIT, "boost/spirit/home/phoenix/statement/detail/catch_all_eval.hpp"))
|
||||
|
||||
#include BOOST_PP_ITERATE()
|
||||
|
||||
};
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
||||
#else if BOOST_PP_ITERATION_DEPTH() == 1
|
||||
|
||||
#define PHOENIX_ITERATION BOOST_PP_ITERATION()
|
||||
|
||||
template<typename Rt, typename Env, typename TryBody,
|
||||
BOOST_PP_ENUM_PARAMS(PHOENIX_ITERATION, typename CatchBody),
|
||||
typename CatchAllBody>
|
||||
static void eval(
|
||||
const Env& env, TryBody& tryBody,
|
||||
BOOST_PP_ENUM_BINARY_PARAMS(PHOENIX_ITERATION, CatchBody, catchBody),
|
||||
CatchAllBody& catchAllBody)
|
||||
{
|
||||
try
|
||||
{
|
||||
tryBody.eval(env);
|
||||
}
|
||||
|
||||
#define BOOST_PP_ITERATION_PARAMS_2 \
|
||||
(3, (0, BOOST_PP_DEC(PHOENIX_ITERATION), "boost/spirit/home/phoenix/statement/detail/catch_all_eval.hpp"))
|
||||
|
||||
#include BOOST_PP_ITERATE()
|
||||
|
||||
catch(...)
|
||||
{
|
||||
catchAllBody.eval(env);
|
||||
}
|
||||
}
|
||||
|
||||
#undef PHOENIX_ITERATION
|
||||
|
||||
#else if BOOST_PP_ITERATION_DEPTH() == 2
|
||||
|
||||
#define PHOENIX_ITERATION BOOST_PP_ITERATION()
|
||||
|
||||
catch(typename BOOST_PP_CAT(CatchBody, PHOENIX_ITERATION)::exception_type&)
|
||||
{
|
||||
BOOST_PP_CAT(catchBody, PHOENIX_ITERATION).eval(env);
|
||||
}
|
||||
|
||||
#undef PHOENIX_ITERATION
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,79 +1,79 @@
|
|||
/*=============================================================================
|
||||
Copyright (c) 2005-2007 Dan Marsden
|
||||
Copyright (c) 2005-2007 Joel de Guzman
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#ifndef BOOST_PP_IS_ITERATING
|
||||
#ifndef PHOENIX_STATEMENT_DETAIL_CATCH_EVAL_HPP
|
||||
#define PHOENIX_STATEMENT_DETAIL_CATCH_EVAL_HPP
|
||||
|
||||
#include <boost/spirit/home/phoenix/core/limits.hpp>
|
||||
#include <boost/preprocessor/iteration/iterate.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params_with_defaults.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_binary_params.hpp>
|
||||
#include <boost/preprocessor/repetition/repeat.hpp>
|
||||
#include <boost/preprocessor/dec.hpp>
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
#include <boost/mpl/void.hpp>
|
||||
|
||||
namespace boost { namespace phoenix {
|
||||
class catch_eval
|
||||
{
|
||||
public:
|
||||
template<typename Env, typename TryBody,
|
||||
BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(PHOENIX_CATCH_LIMIT, typename CatchBody, mpl::void_)>
|
||||
struct result
|
||||
{
|
||||
typedef void type;
|
||||
};
|
||||
|
||||
#define BOOST_PP_ITERATION_PARAMS_1 \
|
||||
(3, (1, PHOENIX_CATCH_LIMIT, "boost/spirit/home/phoenix/statement/detail/catch_eval.hpp"))
|
||||
|
||||
#include BOOST_PP_ITERATE()
|
||||
|
||||
};
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
||||
#elif BOOST_PP_ITERATION_DEPTH() == 1
|
||||
|
||||
#define PHOENIX_ITERATION BOOST_PP_ITERATION()
|
||||
|
||||
template<typename Rt, typename Env, typename TryBody,
|
||||
BOOST_PP_ENUM_PARAMS(PHOENIX_ITERATION, typename CatchBody)>
|
||||
static void eval(
|
||||
const Env& env, TryBody& tryBody,
|
||||
BOOST_PP_ENUM_BINARY_PARAMS(PHOENIX_ITERATION, CatchBody, catchBody))
|
||||
{
|
||||
try
|
||||
{
|
||||
tryBody.eval(env);
|
||||
}
|
||||
|
||||
#define BOOST_PP_ITERATION_PARAMS_2 \
|
||||
(3, (0, BOOST_PP_DEC(PHOENIX_ITERATION), "boost/spirit/home/phoenix/statement/detail/catch_eval.hpp"))
|
||||
|
||||
#include BOOST_PP_ITERATE()
|
||||
|
||||
}
|
||||
|
||||
#undef PHOENIX_ITERATION
|
||||
|
||||
#elif BOOST_PP_ITERATION_DEPTH() == 2
|
||||
|
||||
#define PHOENIX_ITERATION BOOST_PP_ITERATION()
|
||||
|
||||
catch(typename BOOST_PP_CAT(CatchBody, PHOENIX_ITERATION)::exception_type&)
|
||||
{
|
||||
BOOST_PP_CAT(catchBody, PHOENIX_ITERATION).eval(env);
|
||||
}
|
||||
|
||||
#undef PHOENIX_ITERATION
|
||||
|
||||
#endif
|
||||
/*=============================================================================
|
||||
Copyright (c) 2005-2007 Dan Marsden
|
||||
Copyright (c) 2005-2007 Joel de Guzman
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#ifndef BOOST_PP_IS_ITERATING
|
||||
#ifndef PHOENIX_STATEMENT_DETAIL_CATCH_EVAL_HPP
|
||||
#define PHOENIX_STATEMENT_DETAIL_CATCH_EVAL_HPP
|
||||
|
||||
#include <boost/spirit/home/phoenix/core/limits.hpp>
|
||||
#include <boost/preprocessor/iteration/iterate.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params_with_defaults.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_binary_params.hpp>
|
||||
#include <boost/preprocessor/repetition/repeat.hpp>
|
||||
#include <boost/preprocessor/dec.hpp>
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
#include <boost/mpl/void.hpp>
|
||||
|
||||
namespace boost { namespace phoenix {
|
||||
class catch_eval
|
||||
{
|
||||
public:
|
||||
template<typename Env, typename TryBody,
|
||||
BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(PHOENIX_CATCH_LIMIT, typename CatchBody, mpl::void_)>
|
||||
struct result
|
||||
{
|
||||
typedef void type;
|
||||
};
|
||||
|
||||
#define BOOST_PP_ITERATION_PARAMS_1 \
|
||||
(3, (1, PHOENIX_CATCH_LIMIT, "boost/spirit/home/phoenix/statement/detail/catch_eval.hpp"))
|
||||
|
||||
#include BOOST_PP_ITERATE()
|
||||
|
||||
};
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
||||
#else if BOOST_PP_ITERATION_DEPTH() == 1
|
||||
|
||||
#define PHOENIX_ITERATION BOOST_PP_ITERATION()
|
||||
|
||||
template<typename Rt, typename Env, typename TryBody,
|
||||
BOOST_PP_ENUM_PARAMS(PHOENIX_ITERATION, typename CatchBody)>
|
||||
static void eval(
|
||||
const Env& env, TryBody& tryBody,
|
||||
BOOST_PP_ENUM_BINARY_PARAMS(PHOENIX_ITERATION, CatchBody, catchBody))
|
||||
{
|
||||
try
|
||||
{
|
||||
tryBody.eval(env);
|
||||
}
|
||||
|
||||
#define BOOST_PP_ITERATION_PARAMS_2 \
|
||||
(3, (0, BOOST_PP_DEC(PHOENIX_ITERATION), "boost/spirit/home/phoenix/statement/detail/catch_eval.hpp"))
|
||||
|
||||
#include BOOST_PP_ITERATE()
|
||||
|
||||
}
|
||||
|
||||
#undef PHOENIX_ITERATION
|
||||
|
||||
#else if BOOST_PP_ITERATION_DEPTH() == 2
|
||||
|
||||
#define PHOENIX_ITERATION BOOST_PP_ITERATION()
|
||||
|
||||
catch(typename BOOST_PP_CAT(CatchBody, PHOENIX_ITERATION)::exception_type&)
|
||||
{
|
||||
BOOST_PP_CAT(catchBody, PHOENIX_ITERATION).eval(env);
|
||||
}
|
||||
|
||||
#undef PHOENIX_ITERATION
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,231 +1,231 @@
|
|||
|
||||
#if !defined(BOOST_PP_IS_ITERATING)
|
||||
|
||||
///// header body
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// boost variant/detail/substitute.hpp header file
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// Copyright (c) 2003
|
||||
// Eric Friedman
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_VARIANT_DETAIL_SUBSTITUTE_HPP
|
||||
#define BOOST_VARIANT_DETAIL_SUBSTITUTE_HPP
|
||||
|
||||
#include "boost/mpl/aux_/config/ctps.hpp"
|
||||
|
||||
#include "boost/variant/detail/substitute_fwd.hpp"
|
||||
#include "boost/mpl/aux_/lambda_arity_param.hpp"
|
||||
#include "boost/mpl/aux_/preprocessor/params.hpp"
|
||||
#include "boost/mpl/aux_/preprocessor/repeat.hpp"
|
||||
#include "boost/mpl/int_fwd.hpp"
|
||||
#include "boost/mpl/limits/arity.hpp"
|
||||
#include "boost/preprocessor/cat.hpp"
|
||||
#include "boost/preprocessor/empty.hpp"
|
||||
#include "boost/preprocessor/arithmetic/inc.hpp"
|
||||
#include "boost/preprocessor/iterate.hpp"
|
||||
|
||||
namespace boost {
|
||||
namespace detail { namespace variant {
|
||||
|
||||
#if !defined(BOOST_VARIANT_DETAIL_NO_SUBSTITUTE)
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// (detail) metafunction substitute
|
||||
//
|
||||
// Substitutes one type for another in the given type expression.
|
||||
//
|
||||
|
||||
//
|
||||
// primary template
|
||||
//
|
||||
template <
|
||||
typename T, typename Dest, typename Source
|
||||
BOOST_MPL_AUX_LAMBDA_ARITY_PARAM(
|
||||
typename Arity /* = ... (see substitute_fwd.hpp) */
|
||||
)
|
||||
>
|
||||
struct substitute
|
||||
{
|
||||
typedef T type;
|
||||
};
|
||||
|
||||
//
|
||||
// tag substitution specializations
|
||||
//
|
||||
|
||||
#define BOOST_VARIANT_AUX_ENABLE_RECURSIVE_IMPL_SUBSTITUTE_TAG(CV_) \
|
||||
template <typename Dest, typename Source> \
|
||||
struct substitute< \
|
||||
CV_ Source \
|
||||
, Dest \
|
||||
, Source \
|
||||
BOOST_MPL_AUX_LAMBDA_ARITY_PARAM(mpl::int_<-1>) \
|
||||
> \
|
||||
{ \
|
||||
typedef CV_ Dest type; \
|
||||
}; \
|
||||
/**/
|
||||
|
||||
BOOST_VARIANT_AUX_ENABLE_RECURSIVE_IMPL_SUBSTITUTE_TAG( BOOST_PP_EMPTY() )
|
||||
BOOST_VARIANT_AUX_ENABLE_RECURSIVE_IMPL_SUBSTITUTE_TAG(const)
|
||||
BOOST_VARIANT_AUX_ENABLE_RECURSIVE_IMPL_SUBSTITUTE_TAG(volatile)
|
||||
BOOST_VARIANT_AUX_ENABLE_RECURSIVE_IMPL_SUBSTITUTE_TAG(const volatile)
|
||||
|
||||
#undef BOOST_VARIANT_AUX_ENABLE_RECURSIVE_IMPL_SUBSTITUTE_TAG
|
||||
|
||||
//
|
||||
// pointer specializations
|
||||
//
|
||||
#define BOOST_VARIANT_AUX_ENABLE_RECURSIVE_IMPL_HANDLE_POINTER(CV_) \
|
||||
template <typename T, typename Dest, typename Source> \
|
||||
struct substitute< \
|
||||
T * CV_ \
|
||||
, Dest \
|
||||
, Source \
|
||||
BOOST_MPL_AUX_LAMBDA_ARITY_PARAM(mpl::int_<-1>) \
|
||||
> \
|
||||
{ \
|
||||
typedef typename substitute< \
|
||||
T, Dest, Source \
|
||||
>::type * CV_ type; \
|
||||
}; \
|
||||
/**/
|
||||
|
||||
BOOST_VARIANT_AUX_ENABLE_RECURSIVE_IMPL_HANDLE_POINTER( BOOST_PP_EMPTY() )
|
||||
BOOST_VARIANT_AUX_ENABLE_RECURSIVE_IMPL_HANDLE_POINTER(const)
|
||||
BOOST_VARIANT_AUX_ENABLE_RECURSIVE_IMPL_HANDLE_POINTER(volatile)
|
||||
BOOST_VARIANT_AUX_ENABLE_RECURSIVE_IMPL_HANDLE_POINTER(const volatile)
|
||||
|
||||
#undef BOOST_VARIANT_AUX_ENABLE_RECURSIVE_IMPL_HANDLE_POINTER
|
||||
|
||||
//
|
||||
// reference specializations
|
||||
//
|
||||
template <typename T, typename Dest, typename Source>
|
||||
struct substitute<
|
||||
T&
|
||||
, Dest
|
||||
, Source
|
||||
BOOST_MPL_AUX_LAMBDA_ARITY_PARAM(mpl::int_<-1>)
|
||||
>
|
||||
{
|
||||
typedef typename substitute<
|
||||
T, Dest, Source
|
||||
>::type & type;
|
||||
};
|
||||
|
||||
//
|
||||
// template expression (i.e., F<...>) specializations
|
||||
//
|
||||
|
||||
#define BOOST_VARIANT_AUX_SUBSTITUTE_TYPEDEF_IMPL(N) \
|
||||
typedef typename substitute< \
|
||||
BOOST_PP_CAT(U,N), Dest, Source \
|
||||
>::type BOOST_PP_CAT(u,N); \
|
||||
/**/
|
||||
|
||||
#define BOOST_VARIANT_AUX_SUBSTITUTE_TYPEDEF(z, N, _) \
|
||||
BOOST_VARIANT_AUX_SUBSTITUTE_TYPEDEF_IMPL( BOOST_PP_INC(N) ) \
|
||||
/**/
|
||||
|
||||
#define BOOST_PP_ITERATION_LIMITS (0,BOOST_MPL_LIMIT_METAFUNCTION_ARITY)
|
||||
#define BOOST_PP_FILENAME_1 "boost/variant/detail/substitute.hpp"
|
||||
#include BOOST_PP_ITERATE()
|
||||
|
||||
#undef BOOST_VARIANT_AUX_SUBSTITUTE_TYPEDEF_IMPL
|
||||
#undef BOOST_VARIANT_AUX_SUBSTITUTE_TYPEDEF
|
||||
|
||||
#endif // !defined(BOOST_VARIANT_DETAIL_NO_SUBSTITUTE)
|
||||
|
||||
}} // namespace detail::variant
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_VARIANT_DETAIL_SUBSTITUTE_HPP
|
||||
|
||||
///// iteration, depth == 1
|
||||
|
||||
#elif BOOST_PP_ITERATION_DEPTH() == 1
|
||||
#define i BOOST_PP_FRAME_ITERATION(1)
|
||||
|
||||
#if i > 0
|
||||
|
||||
//
|
||||
// template specializations
|
||||
//
|
||||
template <
|
||||
template < BOOST_MPL_PP_PARAMS(i,typename P) > class T
|
||||
, BOOST_MPL_PP_PARAMS(i,typename U)
|
||||
, typename Dest
|
||||
, typename Source
|
||||
>
|
||||
struct substitute<
|
||||
T< BOOST_MPL_PP_PARAMS(i,U) >
|
||||
, Dest
|
||||
, Source
|
||||
BOOST_MPL_AUX_LAMBDA_ARITY_PARAM(mpl::int_<( i )>)
|
||||
>
|
||||
{
|
||||
private:
|
||||
BOOST_MPL_PP_REPEAT(i, BOOST_VARIANT_AUX_SUBSTITUTE_TYPEDEF, _)
|
||||
|
||||
public:
|
||||
typedef T< BOOST_MPL_PP_PARAMS(i,u) > type;
|
||||
};
|
||||
|
||||
//
|
||||
// function specializations
|
||||
//
|
||||
template <
|
||||
typename R
|
||||
, BOOST_MPL_PP_PARAMS(i,typename U)
|
||||
, typename Dest
|
||||
, typename Source
|
||||
>
|
||||
struct substitute<
|
||||
R (*)( BOOST_MPL_PP_PARAMS(i,U) )
|
||||
, Dest
|
||||
, Source
|
||||
BOOST_MPL_AUX_LAMBDA_ARITY_PARAM(mpl::int_<-1>)
|
||||
>
|
||||
{
|
||||
private:
|
||||
typedef typename substitute< R, Dest, Source >::type r;
|
||||
BOOST_MPL_PP_REPEAT(i, BOOST_VARIANT_AUX_SUBSTITUTE_TYPEDEF, _)
|
||||
|
||||
public:
|
||||
typedef r (*type)( BOOST_MPL_PP_PARAMS(i,u) );
|
||||
};
|
||||
|
||||
#elif i == 0
|
||||
|
||||
//
|
||||
// zero-arg function specialization
|
||||
//
|
||||
template <
|
||||
typename R, typename Dest, typename Source
|
||||
>
|
||||
struct substitute<
|
||||
R (*)( void )
|
||||
, Dest
|
||||
, Source
|
||||
BOOST_MPL_AUX_LAMBDA_ARITY_PARAM(mpl::int_<-1>)
|
||||
>
|
||||
{
|
||||
private:
|
||||
typedef typename substitute< R, Dest, Source >::type r;
|
||||
|
||||
public:
|
||||
typedef r (*type)( void );
|
||||
};
|
||||
|
||||
#endif // i
|
||||
|
||||
#undef i
|
||||
#endif // BOOST_PP_IS_ITERATING
|
||||
|
||||
#if !defined(BOOST_PP_IS_ITERATING)
|
||||
|
||||
///// header body
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// boost variant/detail/substitute.hpp header file
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// Copyright (c) 2003
|
||||
// Eric Friedman
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_VARIANT_DETAIL_SUBSTITUTE_HPP
|
||||
#define BOOST_VARIANT_DETAIL_SUBSTITUTE_HPP
|
||||
|
||||
#include "boost/mpl/aux_/config/ctps.hpp"
|
||||
|
||||
#include "boost/variant/detail/substitute_fwd.hpp"
|
||||
#include "boost/mpl/aux_/lambda_arity_param.hpp"
|
||||
#include "boost/mpl/aux_/preprocessor/params.hpp"
|
||||
#include "boost/mpl/aux_/preprocessor/repeat.hpp"
|
||||
#include "boost/mpl/int_fwd.hpp"
|
||||
#include "boost/mpl/limits/arity.hpp"
|
||||
#include "boost/preprocessor/cat.hpp"
|
||||
#include "boost/preprocessor/empty.hpp"
|
||||
#include "boost/preprocessor/arithmetic/inc.hpp"
|
||||
#include "boost/preprocessor/iterate.hpp"
|
||||
|
||||
namespace boost {
|
||||
namespace detail { namespace variant {
|
||||
|
||||
#if !defined(BOOST_VARIANT_DETAIL_NO_SUBSTITUTE)
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// (detail) metafunction substitute
|
||||
//
|
||||
// Substitutes one type for another in the given type expression.
|
||||
//
|
||||
|
||||
//
|
||||
// primary template
|
||||
//
|
||||
template <
|
||||
typename T, typename Dest, typename Source
|
||||
BOOST_MPL_AUX_LAMBDA_ARITY_PARAM(
|
||||
typename Arity /* = ... (see substitute_fwd.hpp) */
|
||||
)
|
||||
>
|
||||
struct substitute
|
||||
{
|
||||
typedef T type;
|
||||
};
|
||||
|
||||
//
|
||||
// tag substitution specializations
|
||||
//
|
||||
|
||||
#define BOOST_VARIANT_AUX_ENABLE_RECURSIVE_IMPL_SUBSTITUTE_TAG(CV_) \
|
||||
template <typename Dest, typename Source> \
|
||||
struct substitute< \
|
||||
CV_ Source \
|
||||
, Dest \
|
||||
, Source \
|
||||
BOOST_MPL_AUX_LAMBDA_ARITY_PARAM(mpl::int_<-1>) \
|
||||
> \
|
||||
{ \
|
||||
typedef CV_ Dest type; \
|
||||
}; \
|
||||
/**/
|
||||
|
||||
BOOST_VARIANT_AUX_ENABLE_RECURSIVE_IMPL_SUBSTITUTE_TAG( BOOST_PP_EMPTY() )
|
||||
BOOST_VARIANT_AUX_ENABLE_RECURSIVE_IMPL_SUBSTITUTE_TAG(const)
|
||||
BOOST_VARIANT_AUX_ENABLE_RECURSIVE_IMPL_SUBSTITUTE_TAG(volatile)
|
||||
BOOST_VARIANT_AUX_ENABLE_RECURSIVE_IMPL_SUBSTITUTE_TAG(const volatile)
|
||||
|
||||
#undef BOOST_VARIANT_AUX_ENABLE_RECURSIVE_IMPL_SUBSTITUTE_TAG
|
||||
|
||||
//
|
||||
// pointer specializations
|
||||
//
|
||||
#define BOOST_VARIANT_AUX_ENABLE_RECURSIVE_IMPL_HANDLE_POINTER(CV_) \
|
||||
template <typename T, typename Dest, typename Source> \
|
||||
struct substitute< \
|
||||
T * CV_ \
|
||||
, Dest \
|
||||
, Source \
|
||||
BOOST_MPL_AUX_LAMBDA_ARITY_PARAM(mpl::int_<-1>) \
|
||||
> \
|
||||
{ \
|
||||
typedef typename substitute< \
|
||||
T, Dest, Source \
|
||||
>::type * CV_ type; \
|
||||
}; \
|
||||
/**/
|
||||
|
||||
BOOST_VARIANT_AUX_ENABLE_RECURSIVE_IMPL_HANDLE_POINTER( BOOST_PP_EMPTY() )
|
||||
BOOST_VARIANT_AUX_ENABLE_RECURSIVE_IMPL_HANDLE_POINTER(const)
|
||||
BOOST_VARIANT_AUX_ENABLE_RECURSIVE_IMPL_HANDLE_POINTER(volatile)
|
||||
BOOST_VARIANT_AUX_ENABLE_RECURSIVE_IMPL_HANDLE_POINTER(const volatile)
|
||||
|
||||
#undef BOOST_VARIANT_AUX_ENABLE_RECURSIVE_IMPL_HANDLE_POINTER
|
||||
|
||||
//
|
||||
// reference specializations
|
||||
//
|
||||
template <typename T, typename Dest, typename Source>
|
||||
struct substitute<
|
||||
T&
|
||||
, Dest
|
||||
, Source
|
||||
BOOST_MPL_AUX_LAMBDA_ARITY_PARAM(mpl::int_<-1>)
|
||||
>
|
||||
{
|
||||
typedef typename substitute<
|
||||
T, Dest, Source
|
||||
>::type & type;
|
||||
};
|
||||
|
||||
//
|
||||
// template expression (i.e., F<...>) specializations
|
||||
//
|
||||
|
||||
#define BOOST_VARIANT_AUX_SUBSTITUTE_TYPEDEF_IMPL(N) \
|
||||
typedef typename substitute< \
|
||||
BOOST_PP_CAT(U,N), Dest, Source \
|
||||
>::type BOOST_PP_CAT(u,N); \
|
||||
/**/
|
||||
|
||||
#define BOOST_VARIANT_AUX_SUBSTITUTE_TYPEDEF(z, N, _) \
|
||||
BOOST_VARIANT_AUX_SUBSTITUTE_TYPEDEF_IMPL( BOOST_PP_INC(N) ) \
|
||||
/**/
|
||||
|
||||
#define BOOST_PP_ITERATION_LIMITS (0,BOOST_MPL_LIMIT_METAFUNCTION_ARITY)
|
||||
#define BOOST_PP_FILENAME_1 "boost/variant/detail/substitute.hpp"
|
||||
#include BOOST_PP_ITERATE()
|
||||
|
||||
#undef BOOST_VARIANT_AUX_SUBSTITUTE_TYPEDEF_IMPL
|
||||
#undef BOOST_VARIANT_AUX_SUBSTITUTE_TYPEDEF
|
||||
|
||||
#endif // !defined(BOOST_VARIANT_DETAIL_NO_SUBSTITUTE)
|
||||
|
||||
}} // namespace detail::variant
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_VARIANT_DETAIL_SUBSTITUTE_HPP
|
||||
|
||||
///// iteration, depth == 1
|
||||
|
||||
#else if BOOST_PP_ITERATION_DEPTH() == 1
|
||||
#define i BOOST_PP_FRAME_ITERATION(1)
|
||||
|
||||
#if i > 0
|
||||
|
||||
//
|
||||
// template specializations
|
||||
//
|
||||
template <
|
||||
template < BOOST_MPL_PP_PARAMS(i,typename P) > class T
|
||||
, BOOST_MPL_PP_PARAMS(i,typename U)
|
||||
, typename Dest
|
||||
, typename Source
|
||||
>
|
||||
struct substitute<
|
||||
T< BOOST_MPL_PP_PARAMS(i,U) >
|
||||
, Dest
|
||||
, Source
|
||||
BOOST_MPL_AUX_LAMBDA_ARITY_PARAM(mpl::int_<( i )>)
|
||||
>
|
||||
{
|
||||
private:
|
||||
BOOST_MPL_PP_REPEAT(i, BOOST_VARIANT_AUX_SUBSTITUTE_TYPEDEF, _)
|
||||
|
||||
public:
|
||||
typedef T< BOOST_MPL_PP_PARAMS(i,u) > type;
|
||||
};
|
||||
|
||||
//
|
||||
// function specializations
|
||||
//
|
||||
template <
|
||||
typename R
|
||||
, BOOST_MPL_PP_PARAMS(i,typename U)
|
||||
, typename Dest
|
||||
, typename Source
|
||||
>
|
||||
struct substitute<
|
||||
R (*)( BOOST_MPL_PP_PARAMS(i,U) )
|
||||
, Dest
|
||||
, Source
|
||||
BOOST_MPL_AUX_LAMBDA_ARITY_PARAM(mpl::int_<-1>)
|
||||
>
|
||||
{
|
||||
private:
|
||||
typedef typename substitute< R, Dest, Source >::type r;
|
||||
BOOST_MPL_PP_REPEAT(i, BOOST_VARIANT_AUX_SUBSTITUTE_TYPEDEF, _)
|
||||
|
||||
public:
|
||||
typedef r (*type)( BOOST_MPL_PP_PARAMS(i,u) );
|
||||
};
|
||||
|
||||
#elif i == 0
|
||||
|
||||
//
|
||||
// zero-arg function specialization
|
||||
//
|
||||
template <
|
||||
typename R, typename Dest, typename Source
|
||||
>
|
||||
struct substitute<
|
||||
R (*)( void )
|
||||
, Dest
|
||||
, Source
|
||||
BOOST_MPL_AUX_LAMBDA_ARITY_PARAM(mpl::int_<-1>)
|
||||
>
|
||||
{
|
||||
private:
|
||||
typedef typename substitute< R, Dest, Source >::type r;
|
||||
|
||||
public:
|
||||
typedef r (*type)( void );
|
||||
};
|
||||
|
||||
#endif // i
|
||||
|
||||
#undef i
|
||||
#endif // BOOST_PP_IS_ITERATING
|
||||
|
|
Loading…
Reference in a new issue