diff options
author | Vlad Voicu <vladv@rosedu.org> | 2012-03-02 10:01:11 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2012-03-09 15:04:05 (GMT) |
commit | 1c8cd160b79b6bbcec72042bdb104ba530508a93 (patch) | |
tree | cff302b81e74c557fbc9e30fd43144d981b613d0 /3rdParty/Boost/src/boost/proto/detail | |
parent | 2944711aefec9a9dd66052440bc4f921910dd780 (diff) | |
download | swift-contrib-1c8cd160b79b6bbcec72042bdb104ba530508a93.zip swift-contrib-1c8cd160b79b6bbcec72042bdb104ba530508a93.tar.bz2 |
Added spirit to bundled boost
Diffstat (limited to '3rdParty/Boost/src/boost/proto/detail')
-rw-r--r-- | 3rdParty/Boost/src/boost/proto/detail/as_expr.hpp | 170 | ||||
-rw-r--r-- | 3rdParty/Boost/src/boost/proto/detail/as_lvalue.hpp | 32 | ||||
-rw-r--r-- | 3rdParty/Boost/src/boost/proto/detail/decltype.hpp | 522 | ||||
-rw-r--r-- | 3rdParty/Boost/src/boost/proto/detail/deduce_domain.hpp | 195 | ||||
-rw-r--r-- | 3rdParty/Boost/src/boost/proto/detail/deprecated.hpp | 247 | ||||
-rw-r--r-- | 3rdParty/Boost/src/boost/proto/detail/expr0.hpp | 460 | ||||
-rw-r--r-- | 3rdParty/Boost/src/boost/proto/detail/expr1.hpp | 47 | ||||
-rw-r--r-- | 3rdParty/Boost/src/boost/proto/detail/funop.hpp | 64 | ||||
-rw-r--r-- | 3rdParty/Boost/src/boost/proto/detail/ignore_unused.hpp | 23 | ||||
-rw-r--r-- | 3rdParty/Boost/src/boost/proto/detail/local.hpp | 52 | ||||
-rw-r--r-- | 3rdParty/Boost/src/boost/proto/detail/poly_function.hpp | 297 |
11 files changed, 2109 insertions, 0 deletions
diff --git a/3rdParty/Boost/src/boost/proto/detail/as_expr.hpp b/3rdParty/Boost/src/boost/proto/detail/as_expr.hpp new file mode 100644 index 0000000..1310fd2 --- /dev/null +++ b/3rdParty/Boost/src/boost/proto/detail/as_expr.hpp @@ -0,0 +1,170 @@ +/////////////////////////////////////////////////////////////////////////////// +/// \file as_expr.hpp +/// Contains definition of the as_expr\<\> and as_child\<\> helper class +/// templates used to implement proto::domain's as_expr\<\> and as_child\<\> +/// member templates. +// +// Copyright 2010 Eric Niebler. 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_PROTO_DETAIL_AS_EXPR_HPP_EAN_06_09_2010 +#define BOOST_PROTO_DETAIL_AS_EXPR_HPP_EAN_06_09_2010 + +#include <boost/config.hpp> +#include <boost/detail/workaround.hpp> +#include <boost/type_traits/remove_const.hpp> +#include <boost/proto/proto_fwd.hpp> +#include <boost/proto/args.hpp> + +namespace boost { namespace proto { namespace detail +{ + + //////////////////////////////////////////////////////////////////////////////////////////////// + template<typename Generator> + struct base_generator + { + typedef Generator type; + }; + + template<typename Generator> + struct base_generator<use_basic_expr<Generator> > + { + typedef Generator type; + }; + + //////////////////////////////////////////////////////////////////////////////////////////////// + template<typename T, typename Generator, bool WantsBasicExpr> + struct as_expr; + + //////////////////////////////////////////////////////////////////////////////////////////////// + template<typename T, typename Generator> + struct as_expr<T, Generator, false> + { + typedef typename term_traits<T &>::value_type value_type; + typedef proto::expr<proto::tag::terminal, term<value_type>, 0> expr_type; + typedef typename Generator::template result<Generator(expr_type)>::type result_type; + + result_type operator()(T &t) const + { + return Generator()(expr_type::make(t)); + } + }; + + //////////////////////////////////////////////////////////////////////////////////////////////// + template<typename T, typename Generator> + struct as_expr<T, Generator, true> + { + typedef typename term_traits<T &>::value_type value_type; + typedef proto::basic_expr<proto::tag::terminal, term<value_type>, 0> expr_type; + typedef typename Generator::template result<Generator(expr_type)>::type result_type; + + result_type operator()(T &t) const + { + return Generator()(expr_type::make(t)); + } + }; + + //////////////////////////////////////////////////////////////////////////////////////////////// + template<typename T> + struct as_expr<T, proto::default_generator, false> + { + typedef typename term_traits<T &>::value_type value_type; + typedef proto::expr<proto::tag::terminal, term<value_type>, 0> result_type; + + result_type operator()(T &t) const + { + return result_type::make(t); + } + }; + + //////////////////////////////////////////////////////////////////////////////////////////////// + template<typename T> + struct as_expr<T, proto::default_generator, true> + { + typedef typename term_traits<T &>::value_type value_type; + typedef proto::basic_expr<proto::tag::terminal, term<value_type>, 0> result_type; + + result_type operator()(T &t) const + { + return result_type::make(t); + } + }; + + //////////////////////////////////////////////////////////////////////////////////////////////// + template<typename T, typename Generator, bool WantsBasicExpr> + struct as_child; + + //////////////////////////////////////////////////////////////////////////////////////////////// + template<typename T, typename Generator> + struct as_child<T, Generator, false> + { + #if BOOST_WORKAROUND(BOOST_MSVC, == 1310) + typedef typename term_traits<T &>::reference reference; + #else + typedef T &reference; + #endif + typedef proto::expr<proto::tag::terminal, term<reference>, 0> expr_type; + typedef typename Generator::template result<Generator(expr_type)>::type result_type; + + result_type operator()(T &t) const + { + return Generator()(expr_type::make(t)); + } + }; + + //////////////////////////////////////////////////////////////////////////////////////////////// + template<typename T, typename Generator> + struct as_child<T, Generator, true> + { + #if BOOST_WORKAROUND(BOOST_MSVC, == 1310) + typedef typename term_traits<T &>::reference reference; + #else + typedef T &reference; + #endif + typedef proto::basic_expr<proto::tag::terminal, term<reference>, 0> expr_type; + typedef typename Generator::template result<Generator(expr_type)>::type result_type; + + result_type operator()(T &t) const + { + return Generator()(expr_type::make(t)); + } + }; + + //////////////////////////////////////////////////////////////////////////////////////////////// + template<typename T> + struct as_child<T, proto::default_generator, false> + { + #if BOOST_WORKAROUND(BOOST_MSVC, == 1310) + typedef typename term_traits<T &>::reference reference; + #else + typedef T &reference; + #endif + typedef proto::expr<proto::tag::terminal, term<reference>, 0> result_type; + + result_type operator()(T &t) const + { + return result_type::make(t); + } + }; + + //////////////////////////////////////////////////////////////////////////////////////////////// + template<typename T> + struct as_child<T, proto::default_generator, true> + { + #if BOOST_WORKAROUND(BOOST_MSVC, == 1310) + typedef typename term_traits<T &>::reference reference; + #else + typedef T &reference; + #endif + typedef proto::basic_expr<proto::tag::terminal, term<reference>, 0> result_type; + + result_type operator()(T &t) const + { + return result_type::make(t); + } + }; + +}}} + +#endif diff --git a/3rdParty/Boost/src/boost/proto/detail/as_lvalue.hpp b/3rdParty/Boost/src/boost/proto/detail/as_lvalue.hpp new file mode 100644 index 0000000..b4b3537 --- /dev/null +++ b/3rdParty/Boost/src/boost/proto/detail/as_lvalue.hpp @@ -0,0 +1,32 @@ +/////////////////////////////////////////////////////////////////////////////// +/// \file as_lvalue.hpp +/// Contains definition the as_lvalue() functions. +// +// Copyright 2008 Eric Niebler. 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_PROTO_TRANSFORM_AS_LVALUE_HPP_EAN_12_27_2007 +#define BOOST_PROTO_TRANSFORM_AS_LVALUE_HPP_EAN_12_27_2007 + +#include <boost/proto/proto_fwd.hpp> + +namespace boost { namespace proto +{ + namespace detail + { + template<typename T> + T &as_lvalue(T &t) + { + return t; + } + + template<typename T> + T const &as_lvalue(T const &t) + { + return t; + } + } +}} + +#endif diff --git a/3rdParty/Boost/src/boost/proto/detail/decltype.hpp b/3rdParty/Boost/src/boost/proto/detail/decltype.hpp new file mode 100644 index 0000000..b8ad6d4 --- /dev/null +++ b/3rdParty/Boost/src/boost/proto/detail/decltype.hpp @@ -0,0 +1,522 @@ +/////////////////////////////////////////////////////////////////////////////// +/// \file decltype.hpp +/// Contains definition the BOOST_PROTO_DECLTYPE_() macro and assorted helpers +// +// Copyright 2008 Eric Niebler. 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_PROTO_DETAIL_DECLTYPE_HPP_EAN_04_04_2008 +#define BOOST_PROTO_DETAIL_DECLTYPE_HPP_EAN_04_04_2008 + +#include <boost/config.hpp> +#include <boost/detail/workaround.hpp> +#include <boost/get_pointer.hpp> +#include <boost/preprocessor/cat.hpp> +#include <boost/preprocessor/repetition/enum_params.hpp> +#include <boost/preprocessor/repetition/enum_trailing_params.hpp> +#include <boost/preprocessor/repetition/enum_binary_params.hpp> +#include <boost/preprocessor/repetition/repeat_from_to.hpp> +#include <boost/preprocessor/iteration/local.hpp> +#include <boost/mpl/if.hpp> +#include <boost/mpl/eval_if.hpp> +#include <boost/mpl/identity.hpp> +#include <boost/type_traits/is_class.hpp> +#include <boost/type_traits/remove_reference.hpp> +#include <boost/type_traits/is_pointer.hpp> +#include <boost/type_traits/is_function.hpp> +#include <boost/type_traits/is_member_object_pointer.hpp> +#include <boost/type_traits/add_const.hpp> +#include <boost/type_traits/add_reference.hpp> +#include <boost/typeof/typeof.hpp> +#include <boost/utility/addressof.hpp> +#include <boost/utility/result_of.hpp> +#include <boost/utility/enable_if.hpp> +#include <boost/proto/repeat.hpp> + +#ifndef BOOST_NO_DECLTYPE +# define BOOST_PROTO_DECLTYPE_(EXPR, TYPE) typedef decltype(EXPR) TYPE; +#else +# define BOOST_PROTO_DECLTYPE_NESTED_TYPEDEF_TPL_(NESTED, EXPR) \ + BOOST_TYPEOF_NESTED_TYPEDEF_TPL(BOOST_PP_CAT(nested_and_hidden_, NESTED), EXPR) \ + static int const sz = sizeof(boost::proto::detail::check_reference(EXPR)); \ + struct NESTED \ + : boost::mpl::if_c< \ + 1==sz \ + , typename BOOST_PP_CAT(nested_and_hidden_, NESTED)::type & \ + , typename BOOST_PP_CAT(nested_and_hidden_, NESTED)::type \ + > \ + {}; +# define BOOST_PROTO_DECLTYPE_(EXPR, TYPE) \ + BOOST_PROTO_DECLTYPE_NESTED_TYPEDEF_TPL_(BOOST_PP_CAT(nested_, TYPE), (EXPR)) \ + typedef typename BOOST_PP_CAT(nested_, TYPE)::type TYPE; +#endif + +namespace boost { namespace proto +{ + namespace detail + { + namespace anyns + { + //////////////////////////////////////////////////////////////////////////////////////////// + struct any + { + any(...); + any operator=(any); + any operator[](any); + #define M0(Z, N, DATA) any operator()(BOOST_PP_ENUM_PARAMS_Z(Z, N, any BOOST_PP_INTERCEPT)); + BOOST_PP_REPEAT(BOOST_PROTO_MAX_ARITY, M0, ~) + #undef M0 + + template<typename T> + operator T &() const volatile; + + any operator+(); + any operator-(); + any operator*(); + any operator&(); + any operator~(); + any operator!(); + any operator++(); + any operator--(); + any operator++(int); + any operator--(int); + + friend any operator<<(any, any); + friend any operator>>(any, any); + friend any operator*(any, any); + friend any operator/(any, any); + friend any operator%(any, any); + friend any operator+(any, any); + friend any operator-(any, any); + friend any operator<(any, any); + friend any operator>(any, any); + friend any operator<=(any, any); + friend any operator>=(any, any); + friend any operator==(any, any); + friend any operator!=(any, any); + friend any operator||(any, any); + friend any operator&&(any, any); + friend any operator&(any, any); + friend any operator|(any, any); + friend any operator^(any, any); + friend any operator,(any, any); + friend any operator->*(any, any); + + friend any operator<<=(any, any); + friend any operator>>=(any, any); + friend any operator*=(any, any); + friend any operator/=(any, any); + friend any operator%=(any, any); + friend any operator+=(any, any); + friend any operator-=(any, any); + friend any operator&=(any, any); + friend any operator|=(any, any); + friend any operator^=(any, any); + }; + } + + using anyns::any; + + //////////////////////////////////////////////////////////////////////////////////////////// + template<typename T> + struct as_mutable + { + typedef T &type; + }; + + template<typename T> + struct as_mutable<T &> + { + typedef T &type; + }; + + template<typename T> + struct as_mutable<T const &> + { + typedef T &type; + }; + + //////////////////////////////////////////////////////////////////////////////////////////// + template<typename T> + T make(); + + //////////////////////////////////////////////////////////////////////////////////////////// + template<typename T> + typename as_mutable<T>::type make_mutable(); + + //////////////////////////////////////////////////////////////////////////////////////////// + template<typename T> + struct subscript_wrapper + : T + { + using T::operator[]; + + #if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1500)) + any operator[](any const volatile &) const volatile; + #else + any operator[](any const &) const volatile; + #endif + }; + + //////////////////////////////////////////////////////////////////////////////////////////// + template<typename T> + struct as_subscriptable + { + typedef + typename mpl::if_c< + is_class<T>::value + , subscript_wrapper<T> + , T + >::type + type; + }; + + template<typename T> + struct as_subscriptable<T const> + { + typedef + typename mpl::if_c< + is_class<T>::value + , subscript_wrapper<T> const + , T const + >::type + type; + }; + + template<typename T> + struct as_subscriptable<T &> + { + typedef + typename mpl::if_c< + is_class<T>::value + , subscript_wrapper<T> & + , T & + >::type + type; + }; + + template<typename T> + struct as_subscriptable<T const &> + { + typedef + typename mpl::if_c< + is_class<T>::value + , subscript_wrapper<T> const & + , T const & + >::type + type; + }; + + //////////////////////////////////////////////////////////////////////////////////////////// + template<typename T> + typename as_subscriptable<T>::type make_subscriptable(); + + //////////////////////////////////////////////////////////////////////////////////////////// + template<typename T> + char check_reference(T &); + + template<typename T> + char (&check_reference(T const &))[2]; + + namespace has_get_pointerns + { + using boost::get_pointer; + void *(&get_pointer(...))[2]; + + //////////////////////////////////////////////////////////////////////////////////////////// + template<typename T> + struct has_get_pointer + { + BOOST_STATIC_CONSTANT(bool, value = sizeof(void *) == sizeof(get_pointer(make<T &>()))); + typedef mpl::bool_<value> type; + }; + } + + using has_get_pointerns::has_get_pointer; + + //////////////////////////////////////////////////////////////////////////////////////////// + template<typename T> + struct classtypeof; + + template<typename T, typename U> + struct classtypeof<T U::*> + { + typedef U type; + }; + + #define BOOST_PP_LOCAL_MACRO(N) \ + template<typename T, typename U BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)> \ + struct classtypeof<T (U::*)(BOOST_PP_ENUM_PARAMS(N, A))> \ + { \ + typedef U type; \ + }; \ + template<typename T, typename U BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)> \ + struct classtypeof<T (U::*)(BOOST_PP_ENUM_PARAMS(N, A)) const> \ + { \ + typedef U type; \ + }; \ + /**/ + #define BOOST_PP_LOCAL_LIMITS (0, BOOST_PROTO_MAX_ARITY) + #include BOOST_PP_LOCAL_ITERATE() + + //////////////////////////////////////////////////////////////////////////////////////////// + template<typename T> + T &lvalue(T &t) + { + return t; + } + + template<typename T> + T const &lvalue(T const &t) + { + return t; + } + + //////////////////////////////////////////////////////////////////////////////////////////// + template<typename U, typename V, typename T> + U *proto_get_pointer(T &t, V *, U *) + { + return boost::addressof(t); + } + + template<typename U, typename V, typename T> + U const *proto_get_pointer(T &t, V *, U const *) + { + return boost::addressof(t); + } + + template<typename U, typename V, typename T> + V *proto_get_pointer(T &t, V *, ...) + { + return get_pointer(t); + } + + //////////////////////////////////////////////////////////////////////////////////////////// + #define BOOST_PROTO_USE_GET_POINTER() \ + using namespace boost::proto::detail::get_pointerns \ + /**/ + + #define BOOST_PROTO_GET_POINTER(Type, Obj) \ + boost::proto::detail::proto_get_pointer<Type>( \ + boost::proto::detail::lvalue(Obj) \ + , (true ? 0 : get_pointer(Obj)) \ + , (true ? 0 : boost::addressof(boost::proto::detail::lvalue(Obj))) \ + ) \ + /**/ + + //////////////////////////////////////////////////////////////////////////////////////////// + namespace get_pointerns + { + using boost::get_pointer; + + template<typename T> + typename disable_if_c<has_get_pointer<T>::value, T *>::type + get_pointer(T &t) + { + return boost::addressof(t); + } + + template<typename T> + typename disable_if_c<has_get_pointer<T>::value, T const *>::type + get_pointer(T const &t) + { + return boost::addressof(t); + } + + char test_ptr_to_const(void *); + char (&test_ptr_to_const(void const *))[2]; + + template<typename U> char test_V_is_a_U(U *); + template<typename U> char test_V_is_a_U(U const *); + template<typename U> char (&test_V_is_a_U(...))[2]; + + //////////////////////////////////////////////////////////////////////////////////////////// + // result_of_ is a wrapper around boost::result_of that also handles "invocations" of + // member object pointers. + template<typename T, typename Void = void> + struct result_of_ + : BOOST_PROTO_RESULT_OF<T> + {}; + + template<typename T, typename U, typename V> + struct result_of_<T U::*(V), typename enable_if_c<is_member_object_pointer<T U::*>::value>::type> + { + BOOST_STATIC_CONSTANT(bool, is_V_a_smart_ptr = 2 == sizeof(test_V_is_a_U<U>(&lvalue(make<V>())))); + BOOST_STATIC_CONSTANT(bool, is_ptr_to_const = 2 == sizeof(test_ptr_to_const(BOOST_PROTO_GET_POINTER(U, make<V>())))); + + // If V is not a U, then it is a (smart) pointer and we can always return an lvalue. + // Otherwise, we can only return an lvalue if we are given one. + typedef + typename mpl::eval_if_c< + (is_V_a_smart_ptr || is_reference<V>::value) + , mpl::eval_if_c< + is_ptr_to_const + , add_reference<typename add_const<T>::type> + , add_reference<T> + > + , mpl::identity<T> + >::type + type; + }; + + //////////////////////////////////////////////////////////////////////////////////////////// + template< + typename T + , typename U + , bool IsMemPtr = is_member_object_pointer< + typename remove_reference<U>::type + >::value + > + struct mem_ptr_fun + { + BOOST_PROTO_DECLTYPE_( + proto::detail::make_mutable<T>() ->* proto::detail::make<U>() + , result_type + ) + + result_type operator()( + typename add_reference<typename add_const<T>::type>::type t + , typename add_reference<typename add_const<U>::type>::type u + ) const + { + return t ->* u; + } + }; + + //////////////////////////////////////////////////////////////////////////////////////////// + template<typename T, typename U> + struct mem_ptr_fun<T, U, true> + { + typedef + typename classtypeof< + typename uncvref<U>::type + >::type + V; + + BOOST_PROTO_DECLTYPE_( + BOOST_PROTO_GET_POINTER(V, proto::detail::make_mutable<T>()) ->* proto::detail::make<U>() + , result_type + ) + + result_type operator()( + typename add_reference<typename add_const<T>::type>::type t + , U u + ) const + { + return BOOST_PROTO_GET_POINTER(V, t) ->* u; + } + }; + } + + using get_pointerns::result_of_; + using get_pointerns::mem_ptr_fun; + + //////////////////////////////////////////////////////////////////////////////////////////// + template<typename A0, typename A1> + struct comma_result + { + BOOST_PROTO_DECLTYPE_((proto::detail::make<A0>(), proto::detail::make<A1>()), type) + }; + + template<typename A0> + struct comma_result<A0, void> + { + typedef void type; + }; + + template<typename A1> + struct comma_result<void, A1> + { + typedef A1 type; + }; + + template<> + struct comma_result<void, void> + { + typedef void type; + }; + + //////////////////////////////////////////////////////////////////////////////////////////// + // normalize a function type for use with boost::result_of + template<typename T, typename U = T> + struct result_of_fixup + : mpl::if_c<is_function<T>::value, T *, U> + {}; + + template<typename T, typename U> + struct result_of_fixup<T &, U> + : result_of_fixup<T, T> + {}; + + template<typename T, typename U> + struct result_of_fixup<T const &, U> + : result_of_fixup<T, T> + {}; + + template<typename T, typename U> + struct result_of_fixup<T *, U> + : result_of_fixup<T, U> + {}; + + template<typename R, typename T, typename U> + struct result_of_fixup<R T::*, U> + { + typedef R T::*type; + }; + + template<typename T, typename U> + struct result_of_fixup<T const, U> + : result_of_fixup<T, U> + {}; + + //// Tests for result_of_fixup + //struct bar {}; + //BOOST_MPL_ASSERT((is_same<bar, result_of_fixup<bar>::type>)); + //BOOST_MPL_ASSERT((is_same<bar const, result_of_fixup<bar const>::type>)); + //BOOST_MPL_ASSERT((is_same<bar, result_of_fixup<bar &>::type>)); + //BOOST_MPL_ASSERT((is_same<bar const, result_of_fixup<bar const &>::type>)); + //BOOST_MPL_ASSERT((is_same<void(*)(), result_of_fixup<void(*)()>::type>)); + //BOOST_MPL_ASSERT((is_same<void(*)(), result_of_fixup<void(* const)()>::type>)); + //BOOST_MPL_ASSERT((is_same<void(*)(), result_of_fixup<void(* const &)()>::type>)); + //BOOST_MPL_ASSERT((is_same<void(*)(), result_of_fixup<void(&)()>::type>)); + + template<typename T, typename PMF> + struct memfun + { + typedef typename uncvref<PMF>::type pmf_type; + typedef typename classtypeof<pmf_type>::type V; + typedef typename BOOST_PROTO_RESULT_OF<pmf_type(T)>::type result_type; + + memfun(T t, PMF p) + : obj(t) + , pmf(p) + {} + + result_type operator()() const + { + BOOST_PROTO_USE_GET_POINTER(); + return (BOOST_PROTO_GET_POINTER(V, obj) ->* pmf)(); + } + + #define BOOST_PROTO_LOCAL_MACRO(N, typename_A, A_const_ref, A_const_ref_a, a) \ + template<typename_A(N)> \ + result_type operator()(A_const_ref_a(N)) const \ + { \ + BOOST_PROTO_USE_GET_POINTER(); \ + return (BOOST_PROTO_GET_POINTER(V, obj) ->* pmf)(a(N)); \ + } \ + /**/ + #define BOOST_PROTO_LOCAL_a BOOST_PROTO_a + #define BOOST_PROTO_LOCAL_LIMITS (1, BOOST_PROTO_MAX_ARITY) + #include BOOST_PROTO_LOCAL_ITERATE() + + private: + T obj; + PMF pmf; + }; + + } // namespace detail +}} + +#endif diff --git a/3rdParty/Boost/src/boost/proto/detail/deduce_domain.hpp b/3rdParty/Boost/src/boost/proto/detail/deduce_domain.hpp new file mode 100644 index 0000000..4e4262d --- /dev/null +++ b/3rdParty/Boost/src/boost/proto/detail/deduce_domain.hpp @@ -0,0 +1,195 @@ +/////////////////////////////////////////////////////////////////////////////// +/// \file deduce_domain.hpp +/// Contains definition of deduce_domain\<\> class templates +/// for finding the domain that is common among the specified +/// domains +// +// Copyright 2010 Daniel Wallin, Eric Niebler. 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) +// +// Many thanks to Daniel Wallin who first implemented this code. Thanks +// also to Jeremiah Willcock, John Bytheway and Krishna Achuthan who +// offered alternate solutions to this tricky programming problem. + +#ifndef BOOST_PROTO_DEDUCE_DOMAIN_HPP_EAN_05_22_2010 +#define BOOST_PROTO_DEDUCE_DOMAIN_HPP_EAN_05_22_2010 + +#include <boost/config.hpp> +#include <boost/preprocessor/cat.hpp> +#include <boost/preprocessor/facilities/intercept.hpp> +#include <boost/preprocessor/iteration/local.hpp> +#include <boost/preprocessor/repetition/enum_params.hpp> +#include <boost/preprocessor/repetition/enum_binary_params.hpp> +#include <boost/preprocessor/repetition/repeat_from_to.hpp> +#include <boost/preprocessor/arithmetic/inc.hpp> +#include <boost/mpl/assert.hpp> +#include <boost/type_traits/is_same.hpp> +#include <boost/proto/proto_fwd.hpp> + +#ifndef BOOST_PROTO_ASSERT_VALID_DOMAIN +# define BOOST_PROTO_ASSERT_VALID_DOMAIN(DOM) BOOST_MPL_ASSERT_NOT((boost::is_same<DOM, boost::proto::detail::not_a_domain>)) +#endif + +namespace boost +{ + namespace proto + { + namespace detail + { + template<int N> + struct sized_type + { + typedef char (&type)[N]; + }; + + template<typename Domain> + struct domain_ + : domain_<typename Domain::proto_super_domain> + { + typedef Domain type; + typedef domain_<typename Domain::proto_super_domain> base; + #ifdef BOOST_NO_DECLTYPE + using base::deduce98; + static int const index = base::index + 1; + static typename sized_type<index>::type deduce98(domain_<Domain>*); + #else + using base::deduce0x; + static Domain deduce0x(domain_<Domain>*); + #endif + }; + + template<> + struct domain_<not_a_domain> + { + typedef not_a_domain type; + #ifdef BOOST_NO_DECLTYPE + static int const index = 1; + static sized_type<1>::type deduce98(void*); + #else + static not_a_domain deduce0x(void*); + #endif + }; + + template<> + struct domain_<default_domain> + : domain_<not_a_domain> + {}; + + sized_type<1>::type default_test(void*, void*); + sized_type<2>::type default_test(domain_<default_domain>*, void*); + sized_type<3>::type default_test(void*, domain_<default_domain>*); + sized_type<4>::type default_test(domain_<default_domain>*, domain_<default_domain>*); + + #ifdef BOOST_NO_DECLTYPE + template<int N, typename Domain> + struct nth_domain + : nth_domain<N - 1, typename Domain::base> + {}; + + template<typename Domain> + struct nth_domain<0, Domain> + : Domain + {}; + #endif + + template<typename D0> + struct common_domain1 + { + typedef D0 type; + }; + + template<typename E0> + struct deduce_domain1 + : domain_of<E0> + {}; + + template< + typename D0 + , typename D1 + , int DefaultCase = sizeof(proto::detail::default_test((domain_<D0>*)0, (domain_<D1>*)0)) + > + struct common_domain2 + { + #ifdef BOOST_NO_DECLTYPE + static int const index = domain_<D0>::index - sizeof(domain_<D0>::deduce98((domain_<D1>*)0)); + typedef typename nth_domain<index, domain_<D0> >::type type; + #else + typedef decltype(domain_<D0>::deduce0x((domain_<D1>*)0)) type; + #endif + }; + + template<typename D0, typename D1> + struct common_domain2<D0, D1, 2> + { + typedef D1 type; + }; + + template<typename D0, typename D1> + struct common_domain2<D0, D1, 3> + { + typedef D0 type; + }; + + template<typename D0> + struct common_domain2<D0, default_domain, 4> + { + typedef D0 type; + }; + + template<typename D1> + struct common_domain2<default_domain, D1, 4> + { + typedef D1 type; + }; + + template<> + struct common_domain2<default_domain, default_domain, 4> + { + typedef default_domain type; + }; + + template<typename E0, typename E1> + struct deduce_domain2 + : common_domain2< + typename domain_of<E0>::type + , typename domain_of<E1>::type + > + {}; + + #define M0(Z, N, DATA) \ + typedef \ + typename common_domain2<common ## N, A ## N>::type \ + BOOST_PP_CAT(common, BOOST_PP_INC(N)); \ + /**/ + + #define BOOST_PP_LOCAL_MACRO(N) \ + template<BOOST_PP_ENUM_PARAMS(N, typename A)> \ + struct BOOST_PP_CAT(common_domain, N) \ + { \ + typedef A0 common1; \ + BOOST_PP_REPEAT_FROM_TO(1, N, M0, ~) \ + typedef common ## N type; \ + BOOST_PROTO_ASSERT_VALID_DOMAIN(type); \ + }; \ + \ + template<BOOST_PP_ENUM_PARAMS(N, typename E)> \ + struct BOOST_PP_CAT(deduce_domain, N) \ + : BOOST_PP_CAT(common_domain, N)< \ + BOOST_PP_ENUM_BINARY_PARAMS( \ + N \ + , typename domain_of<E, >::type BOOST_PP_INTERCEPT \ + ) \ + > \ + {}; \ + /**/ + + #define BOOST_PP_LOCAL_LIMITS (3, BOOST_PROTO_MAX_ARITY) + #include BOOST_PP_LOCAL_ITERATE() + + #undef M0 + } + } +} + +#endif // BOOST_PROTO_DEDUCE_DOMAIN_HPP_EAN_05_22_2010 diff --git a/3rdParty/Boost/src/boost/proto/detail/deprecated.hpp b/3rdParty/Boost/src/boost/proto/detail/deprecated.hpp new file mode 100644 index 0000000..d8dec6d --- /dev/null +++ b/3rdParty/Boost/src/boost/proto/detail/deprecated.hpp @@ -0,0 +1,247 @@ +/////////////////////////////////////////////////////////////////////////////// +/// \file deprecated.hpp +/// Definition of the deprecated BOOST_PROTO_DEFINE_FUCTION_TEMPLATE and +/// BOOST_PROTO_DEFINE_VARARG_FUCTION_TEMPLATE macros +// +// Copyright 2008 Eric Niebler. 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_PROTO_DETAIL_DEPRECATED_HPP_EAN_11_25_2008 +#define BOOST_PROTO_DETAIL_DEPRECATED_HPP_EAN_11_25_2008 + +#include <boost/preprocessor/cat.hpp> +#include <boost/preprocessor/facilities/intercept.hpp> +#include <boost/preprocessor/arithmetic/inc.hpp> +#include <boost/preprocessor/arithmetic/dec.hpp> +#include <boost/preprocessor/arithmetic/sub.hpp> +#include <boost/preprocessor/punctuation/comma_if.hpp> +#include <boost/preprocessor/control/if.hpp> +#include <boost/preprocessor/control/expr_if.hpp> +#include <boost/preprocessor/comparison/greater.hpp> +#include <boost/preprocessor/tuple/elem.hpp> +#include <boost/preprocessor/tuple/to_list.hpp> +#include <boost/preprocessor/logical/and.hpp> +#include <boost/preprocessor/seq/size.hpp> +#include <boost/preprocessor/seq/enum.hpp> +#include <boost/preprocessor/seq/seq.hpp> +#include <boost/preprocessor/seq/to_tuple.hpp> +#include <boost/preprocessor/seq/for_each_i.hpp> +#include <boost/preprocessor/seq/pop_back.hpp> +#include <boost/preprocessor/seq/push_back.hpp> +#include <boost/preprocessor/seq/push_front.hpp> +#include <boost/preprocessor/list/for_each_i.hpp> +#include <boost/preprocessor/repetition/repeat.hpp> +#include <boost/preprocessor/repetition/repeat_from_to.hpp> +#include <boost/preprocessor/repetition/enum_binary_params.hpp> +#include <boost/preprocessor/repetition/enum_trailing_binary_params.hpp> +#include <boost/proto/proto_fwd.hpp> + +/// INTERNAL ONLY +/// +#define BOOST_PROTO_VARARG_TEMPLATE_AUX_(R, DATA, I, ELEM) \ + (ELEM BOOST_PP_CAT(BOOST_PP_CAT(X, DATA), BOOST_PP_CAT(_, I))) \ + /**/ + +/// INTERNAL ONLY +/// +#define BOOST_PROTO_VARARG_TEMPLATE_YES_(R, DATA, I, ELEM) \ + BOOST_PP_LIST_FOR_EACH_I_R( \ + R \ + , BOOST_PROTO_VARARG_TEMPLATE_AUX_ \ + , I \ + , BOOST_PP_TUPLE_TO_LIST( \ + BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(ELEM)) \ + , BOOST_PP_SEQ_TO_TUPLE(BOOST_PP_SEQ_TAIL(ELEM)) \ + ) \ + ) \ + /**/ + +/// INTERNAL ONLY +/// +#define BOOST_PROTO_VARARG_TEMPLATE_NO_(R, DATA, I, ELEM) \ + /**/ + +/// INTERNAL ONLY +/// +#define BOOST_PROTO_VARARG_TEMPLATE_(R, DATA, I, ELEM) \ + BOOST_PP_IF( \ + BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(ELEM)) \ + , BOOST_PROTO_VARARG_TEMPLATE_YES_ \ + , BOOST_PROTO_VARARG_TEMPLATE_NO_ \ + )(R, DATA, I, ELEM) \ + /**/ + +/// INTERNAL ONLY +/// +#define BOOST_PROTO_VARARG_TYPE_AUX_(R, DATA, I, ELEM) \ + (BOOST_PP_CAT(BOOST_PP_CAT(X, DATA), BOOST_PP_CAT(_, I))) \ + /**/ + +/// INTERNAL ONLY +/// +#define BOOST_PROTO_TEMPLATE_PARAMS_YES_(R, DATA, I, ELEM) \ + < \ + BOOST_PP_SEQ_ENUM( \ + BOOST_PP_LIST_FOR_EACH_I_R( \ + R \ + , BOOST_PROTO_VARARG_TYPE_AUX_ \ + , I \ + , BOOST_PP_TUPLE_TO_LIST( \ + BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(ELEM)) \ + , BOOST_PP_SEQ_TO_TUPLE(BOOST_PP_SEQ_TAIL(ELEM)) \ + ) \ + ) \ + ) \ + > \ + /**/ + +/// INTERNAL ONLY +/// +#define BOOST_PROTO_TEMPLATE_PARAMS_NO_(R, DATA, I, ELEM) \ + /**/ + +/// INTERNAL ONLY +/// +#define BOOST_PROTO_VARARG_TYPE_(R, DATA, I, ELEM) \ + BOOST_PP_COMMA_IF(I) \ + BOOST_PP_SEQ_HEAD(ELEM) \ + BOOST_PP_IF( \ + BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(ELEM)) \ + , BOOST_PROTO_TEMPLATE_PARAMS_YES_ \ + , BOOST_PROTO_TEMPLATE_PARAMS_NO_ \ + )(R, DATA, I, ELEM) BOOST_PP_EXPR_IF(BOOST_PP_GREATER(I, 1), const) \ + /**/ + +/// INTERNAL ONLY +/// +#define BOOST_PROTO_VARARG_AS_EXPR_(R, DATA, I, ELEM) \ + BOOST_PP_EXPR_IF( \ + BOOST_PP_GREATER(I, 1) \ + , (( \ + BOOST_PP_SEQ_HEAD(ELEM) \ + BOOST_PP_IF( \ + BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(ELEM)) \ + , BOOST_PROTO_TEMPLATE_PARAMS_YES_ \ + , BOOST_PROTO_TEMPLATE_PARAMS_NO_ \ + )(R, DATA, I, ELEM)() \ + )) \ + ) \ + /**/ + +/// INTERNAL ONLY +/// +#define BOOST_PROTO_VARARG_AS_CHILD_(Z, N, DATA) \ + (BOOST_PP_CAT(DATA, N)) \ + /**/ + +/// INTERNAL ONLY +/// +#define BOOST_PROTO_SEQ_PUSH_FRONT(SEQ, ELEM) \ + BOOST_PP_SEQ_POP_BACK(BOOST_PP_SEQ_PUSH_FRONT(BOOST_PP_SEQ_PUSH_BACK(SEQ, _dummy_), ELEM)) \ + /**/ + +/// INTERNAL ONLY +/// +#define BOOST_PROTO_VARARG_AS_PARAM_(Z, N, DATA) \ + (BOOST_PP_CAT(DATA, N)) \ + /**/ + +/// INTERNAL ONLY +/// +#define BOOST_PROTO_VARARG_FUN_(Z, N, DATA) \ + template< \ + BOOST_PP_SEQ_ENUM( \ + BOOST_PP_SEQ_FOR_EACH_I( \ + BOOST_PROTO_VARARG_TEMPLATE_, ~ \ + , BOOST_PP_SEQ_PUSH_FRONT( \ + BOOST_PROTO_SEQ_PUSH_FRONT( \ + BOOST_PP_TUPLE_ELEM(4, 2, DATA) \ + , (BOOST_PP_TUPLE_ELEM(4, 3, DATA)) \ + ) \ + , BOOST_PP_TUPLE_ELEM(4, 1, DATA) \ + ) \ + ) \ + BOOST_PP_REPEAT_ ## Z(N, BOOST_PROTO_VARARG_AS_PARAM_, typename A) \ + ) \ + > \ + typename boost::proto::result_of::make_expr< \ + BOOST_PP_SEQ_FOR_EACH_I( \ + BOOST_PROTO_VARARG_TYPE_, ~ \ + , BOOST_PP_SEQ_PUSH_FRONT( \ + BOOST_PROTO_SEQ_PUSH_FRONT( \ + BOOST_PP_TUPLE_ELEM(4, 2, DATA) \ + , (BOOST_PP_TUPLE_ELEM(4, 3, DATA)) \ + ) \ + , BOOST_PP_TUPLE_ELEM(4, 1, DATA) \ + ) \ + ) \ + BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_Z(Z, N, A, const & BOOST_PP_INTERCEPT) \ + >::type const \ + BOOST_PP_TUPLE_ELEM(4, 0, DATA)(BOOST_PP_ENUM_BINARY_PARAMS_Z(Z, N, A, const &a)) \ + { \ + return boost::proto::detail::make_expr_< \ + BOOST_PP_SEQ_FOR_EACH_I( \ + BOOST_PROTO_VARARG_TYPE_, ~ \ + , BOOST_PP_SEQ_PUSH_FRONT( \ + BOOST_PROTO_SEQ_PUSH_FRONT( \ + BOOST_PP_TUPLE_ELEM(4, 2, DATA) \ + , (BOOST_PP_TUPLE_ELEM(4, 3, DATA)) \ + ) \ + , BOOST_PP_TUPLE_ELEM(4, 1, DATA) \ + ) \ + ) \ + BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_Z(Z, N, A, const & BOOST_PP_INTERCEPT) \ + >()( \ + BOOST_PP_SEQ_ENUM( \ + BOOST_PP_SEQ_FOR_EACH_I( \ + BOOST_PROTO_VARARG_AS_EXPR_, ~ \ + , BOOST_PP_SEQ_PUSH_FRONT( \ + BOOST_PROTO_SEQ_PUSH_FRONT( \ + BOOST_PP_TUPLE_ELEM(4, 2, DATA) \ + , (BOOST_PP_TUPLE_ELEM(4, 3, DATA)) \ + ) \ + , BOOST_PP_TUPLE_ELEM(4, 1, DATA) \ + ) \ + ) \ + BOOST_PP_REPEAT_ ## Z(N, BOOST_PROTO_VARARG_AS_CHILD_, a) \ + ) \ + ); \ + } \ + /**/ + +/// \code +/// BOOST_PROTO_DEFINE_FUNCTION_TEMPLATE( +/// 1 +/// , construct +/// , boost::proto::default_domain +/// , (boost::proto::tag::function) +/// , ((op::construct)(typename)(int)) +/// ) +/// \endcode +#define BOOST_PROTO_DEFINE_FUNCTION_TEMPLATE(ARGCOUNT, NAME, DOMAIN, TAG, BOUNDARGS) \ + BOOST_PP_REPEAT_FROM_TO( \ + ARGCOUNT \ + , BOOST_PP_INC(ARGCOUNT) \ + , BOOST_PROTO_VARARG_FUN_ \ + , (NAME, TAG, BOUNDARGS, DOMAIN) \ + )\ + /**/ + +/// \code +/// BOOST_PROTO_DEFINE_VARARG_FUNCTION_TEMPLATE( +/// construct +/// , boost::proto::default_domain +/// , (boost::proto::tag::function) +/// , ((op::construct)(typename)(int)) +/// ) +/// \endcode +#define BOOST_PROTO_DEFINE_VARARG_FUNCTION_TEMPLATE(NAME, DOMAIN, TAG, BOUNDARGS) \ + BOOST_PP_REPEAT( \ + BOOST_PP_SUB(BOOST_PP_INC(BOOST_PROTO_MAX_ARITY), BOOST_PP_SEQ_SIZE(BOUNDARGS)) \ + , BOOST_PROTO_VARARG_FUN_ \ + , (NAME, TAG, BOUNDARGS, DOMAIN) \ + ) \ + /**/ + +#endif diff --git a/3rdParty/Boost/src/boost/proto/detail/expr0.hpp b/3rdParty/Boost/src/boost/proto/detail/expr0.hpp new file mode 100644 index 0000000..f1e1f25 --- /dev/null +++ b/3rdParty/Boost/src/boost/proto/detail/expr0.hpp @@ -0,0 +1,460 @@ +/////////////////////////////////////////////////////////////////////////////// +// expr.hpp +// Contains definition of expr\<\> class template. +// +// Copyright 2008 Eric Niebler. 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 +#error Do not include this file directly +#endif + +#define ARG_COUNT BOOST_PP_MAX(1, BOOST_PP_ITERATION()) + + /// \brief Simplified representation of a node in an expression tree. + /// + /// \c proto::basic_expr\<\> is a node in an expression template tree. It + /// is a container for its child sub-trees. It also serves as + /// the terminal nodes of the tree. + /// + /// \c Tag is type that represents the operation encoded by + /// this expression. It is typically one of the structs + /// in the \c boost::proto::tag namespace, but it doesn't + /// have to be. + /// + /// \c Args is a type list representing the type of the children + /// of this expression. It is an instantiation of one + /// of \c proto::list1\<\>, \c proto::list2\<\>, etc. The + /// child types must all themselves be either \c expr\<\> + /// or <tt>proto::expr\<\>&</tt>. If \c Args is an + /// instantiation of \c proto::term\<\> then this + /// \c expr\<\> type represents a terminal expression; + /// the parameter to the \c proto::term\<\> template + /// represents the terminal's value type. + /// + /// \c Arity is an integral constant representing the number of child + /// nodes this node contains. If \c Arity is 0, then this + /// node is a terminal. + /// + /// \c proto::basic_expr\<\> is a valid Fusion random-access sequence, where + /// the elements of the sequence are the child expressions. + #ifdef BOOST_PROTO_DEFINE_TERMINAL + template<typename Tag, typename Arg0> + struct basic_expr<Tag, term<Arg0>, 0> + #else + template<typename Tag BOOST_PP_ENUM_TRAILING_PARAMS(ARG_COUNT, typename Arg)> + struct basic_expr<Tag, BOOST_PP_CAT(list, BOOST_PP_ITERATION())<BOOST_PP_ENUM_PARAMS(ARG_COUNT, Arg)>, BOOST_PP_ITERATION() > + #endif + { + typedef Tag proto_tag; + BOOST_STATIC_CONSTANT(long, proto_arity_c = BOOST_PP_ITERATION()); + typedef mpl::long_<BOOST_PP_ITERATION() > proto_arity; + typedef basic_expr proto_base_expr; + #ifdef BOOST_PROTO_DEFINE_TERMINAL + typedef term<Arg0> proto_args; + #else + typedef BOOST_PP_CAT(list, BOOST_PP_ITERATION())<BOOST_PP_ENUM_PARAMS(ARG_COUNT, Arg)> proto_args; + #endif + typedef basic_expr proto_grammar; + typedef default_domain proto_domain; + typedef default_generator proto_generator; + typedef proto::tag::proto_expr fusion_tag; + typedef basic_expr proto_derived_expr; + typedef void proto_is_expr_; /**< INTERNAL ONLY */ + + BOOST_PP_REPEAT(ARG_COUNT, BOOST_PROTO_CHILD, ~) + BOOST_PP_REPEAT_FROM_TO(ARG_COUNT, BOOST_PROTO_MAX_ARITY, BOOST_PROTO_VOID, ~) + + /// \return *this + /// + basic_expr const &proto_base() const + { + return *this; + } + + /// \overload + /// + basic_expr &proto_base() + { + return *this; + } + + #ifdef BOOST_PROTO_DEFINE_TERMINAL + /// \return A new \c expr\<\> object initialized with the specified + /// arguments. + /// + template<typename A0> + static basic_expr const make(A0 &a0) + { + return detail::make_terminal(a0, static_cast<basic_expr *>(0), static_cast<proto_args *>(0)); + } + + /// \overload + /// + template<typename A0> + static basic_expr const make(A0 const &a0) + { + return detail::make_terminal(a0, static_cast<basic_expr *>(0), static_cast<proto_args *>(0)); + } + #else + /// \return A new \c expr\<\> object initialized with the specified + /// arguments. + /// + template<BOOST_PP_ENUM_PARAMS(ARG_COUNT, typename A)> + static basic_expr const make(BOOST_PP_ENUM_BINARY_PARAMS(ARG_COUNT, A, const &a)) + { + basic_expr that = {BOOST_PP_ENUM_PARAMS(ARG_COUNT, a)}; + return that; + } + #endif + + #if 1 == BOOST_PP_ITERATION() + /// If \c Tag is \c boost::proto::tag::address_of and \c proto_child0 is + /// <tt>T&</tt>, then \c address_of_hack_type_ is <tt>T*</tt>. + /// Otherwise, it is some undefined type. + typedef typename detail::address_of_hack<Tag, proto_child0>::type address_of_hack_type_; + + /// \return The address of <tt>this->child0</tt> if \c Tag is + /// \c boost::proto::tag::address_of. Otherwise, this function will + /// fail to compile. + /// + /// \attention Proto overloads <tt>operator&</tt>, which means that + /// proto-ified objects cannot have their addresses taken, unless we use + /// the following hack to make \c &x implicitly convertible to \c X*. + operator address_of_hack_type_() const + { + return boost::addressof(this->child0); + } + #else + /// INTERNAL ONLY + /// + typedef detail::not_a_valid_type address_of_hack_type_; + #endif + }; + + /// \brief Representation of a node in an expression tree. + /// + /// \c proto::expr\<\> is a node in an expression template tree. It + /// is a container for its child sub-trees. It also serves as + /// the terminal nodes of the tree. + /// + /// \c Tag is type that represents the operation encoded by + /// this expression. It is typically one of the structs + /// in the \c boost::proto::tag namespace, but it doesn't + /// have to be. + /// + /// \c Args is a type list representing the type of the children + /// of this expression. It is an instantiation of one + /// of \c proto::list1\<\>, \c proto::list2\<\>, etc. The + /// child types must all themselves be either \c expr\<\> + /// or <tt>proto::expr\<\>&</tt>. If \c Args is an + /// instantiation of \c proto::term\<\> then this + /// \c expr\<\> type represents a terminal expression; + /// the parameter to the \c proto::term\<\> template + /// represents the terminal's value type. + /// + /// \c Arity is an integral constant representing the number of child + /// nodes this node contains. If \c Arity is 0, then this + /// node is a terminal. + /// + /// \c proto::expr\<\> is a valid Fusion random-access sequence, where + /// the elements of the sequence are the child expressions. + #ifdef BOOST_PROTO_DEFINE_TERMINAL + template<typename Tag, typename Arg0> + struct expr<Tag, term<Arg0>, 0> + #else + template<typename Tag BOOST_PP_ENUM_TRAILING_PARAMS(ARG_COUNT, typename Arg)> + struct expr<Tag, BOOST_PP_CAT(list, BOOST_PP_ITERATION())<BOOST_PP_ENUM_PARAMS(ARG_COUNT, Arg)>, BOOST_PP_ITERATION() > + #endif + { + typedef Tag proto_tag; + BOOST_STATIC_CONSTANT(long, proto_arity_c = BOOST_PP_ITERATION()); + typedef mpl::long_<BOOST_PP_ITERATION() > proto_arity; + typedef expr proto_base_expr; + #ifdef BOOST_PROTO_DEFINE_TERMINAL + typedef term<Arg0> proto_args; + #else + typedef BOOST_PP_CAT(list, BOOST_PP_ITERATION())<BOOST_PP_ENUM_PARAMS(ARG_COUNT, Arg)> proto_args; + #endif + typedef basic_expr<Tag, proto_args, BOOST_PP_ITERATION() > proto_grammar; + typedef default_domain proto_domain; + typedef default_generator proto_generator; + typedef proto::tag::proto_expr fusion_tag; + typedef expr proto_derived_expr; + typedef void proto_is_expr_; /**< INTERNAL ONLY */ + + BOOST_PP_REPEAT(ARG_COUNT, BOOST_PROTO_CHILD, ~) + BOOST_PP_REPEAT_FROM_TO(ARG_COUNT, BOOST_PROTO_MAX_ARITY, BOOST_PROTO_VOID, ~) + + /// \return *this + /// + expr const &proto_base() const + { + return *this; + } + + /// \overload + /// + expr &proto_base() + { + return *this; + } + + #ifdef BOOST_PROTO_DEFINE_TERMINAL + /// \return A new \c expr\<\> object initialized with the specified + /// arguments. + /// + template<typename A0> + static expr const make(A0 &a0) + { + return detail::make_terminal(a0, static_cast<expr *>(0), static_cast<proto_args *>(0)); + } + + /// \overload + /// + template<typename A0> + static expr const make(A0 const &a0) + { + return detail::make_terminal(a0, static_cast<expr *>(0), static_cast<proto_args *>(0)); + } + #else + /// \return A new \c expr\<\> object initialized with the specified + /// arguments. + /// + template<BOOST_PP_ENUM_PARAMS(ARG_COUNT, typename A)> + static expr const make(BOOST_PP_ENUM_BINARY_PARAMS(ARG_COUNT, A, const &a)) + { + expr that = {BOOST_PP_ENUM_PARAMS(ARG_COUNT, a)}; + return that; + } + #endif + + #if 1 == BOOST_PP_ITERATION() + /// If \c Tag is \c boost::proto::tag::address_of and \c proto_child0 is + /// <tt>T&</tt>, then \c address_of_hack_type_ is <tt>T*</tt>. + /// Otherwise, it is some undefined type. + typedef typename detail::address_of_hack<Tag, proto_child0>::type address_of_hack_type_; + + /// \return The address of <tt>this->child0</tt> if \c Tag is + /// \c boost::proto::tag::address_of. Otherwise, this function will + /// fail to compile. + /// + /// \attention Proto overloads <tt>operator&</tt>, which means that + /// proto-ified objects cannot have their addresses taken, unless we use + /// the following hack to make \c &x implicitly convertible to \c X*. + operator address_of_hack_type_() const + { + return boost::addressof(this->child0); + } + #else + /// INTERNAL ONLY + /// + typedef detail::not_a_valid_type address_of_hack_type_; + #endif + + /// Assignment + /// + /// \param a The rhs. + /// \return A new \c expr\<\> node representing an assignment of \c that to \c *this. + proto::expr< + proto::tag::assign + , list2<expr &, expr const &> + , 2 + > const + operator =(expr const &a) + { + proto::expr< + proto::tag::assign + , list2<expr &, expr const &> + , 2 + > that = {*this, a}; + return that; + } + + /// Assignment + /// + /// \param a The rhs. + /// \return A new \c expr\<\> node representing an assignment of \c a to \c *this. + template<typename A> + proto::expr< + proto::tag::assign + , list2<expr const &, typename result_of::as_child<A>::type> + , 2 + > const + operator =(A &a) const + { + proto::expr< + proto::tag::assign + , list2<expr const &, typename result_of::as_child<A>::type> + , 2 + > that = {*this, proto::as_child(a)}; + return that; + } + + /// \overload + /// + template<typename A> + proto::expr< + proto::tag::assign + , list2<expr const &, typename result_of::as_child<A const>::type> + , 2 + > const + operator =(A const &a) const + { + proto::expr< + proto::tag::assign + , list2<expr const &, typename result_of::as_child<A const>::type> + , 2 + > that = {*this, proto::as_child(a)}; + return that; + } + + #ifdef BOOST_PROTO_DEFINE_TERMINAL + /// \overload + /// + template<typename A> + proto::expr< + proto::tag::assign + , list2<expr &, typename result_of::as_child<A>::type> + , 2 + > const + operator =(A &a) + { + proto::expr< + proto::tag::assign + , list2<expr &, typename result_of::as_child<A>::type> + , 2 + > that = {*this, proto::as_child(a)}; + return that; + } + + /// \overload + /// + template<typename A> + proto::expr< + proto::tag::assign + , list2<expr &, typename result_of::as_child<A const>::type> + , 2 + > const + operator =(A const &a) + { + proto::expr< + proto::tag::assign + , list2<expr &, typename result_of::as_child<A const>::type> + , 2 + > that = {*this, proto::as_child(a)}; + return that; + } + #endif + + /// Subscript + /// + /// \param a The rhs. + /// \return A new \c expr\<\> node representing \c *this subscripted with \c a. + template<typename A> + proto::expr< + proto::tag::subscript + , list2<expr const &, typename result_of::as_child<A>::type> + , 2 + > const + operator [](A &a) const + { + proto::expr< + proto::tag::subscript + , list2<expr const &, typename result_of::as_child<A>::type> + , 2 + > that = {*this, proto::as_child(a)}; + return that; + } + + /// \overload + /// + template<typename A> + proto::expr< + proto::tag::subscript + , list2<expr const &, typename result_of::as_child<A const>::type> + , 2 + > const + operator [](A const &a) const + { + proto::expr< + proto::tag::subscript + , list2<expr const &, typename result_of::as_child<A const>::type> + , 2 + > that = {*this, proto::as_child(a)}; + return that; + } + + #ifdef BOOST_PROTO_DEFINE_TERMINAL + /// \overload + /// + template<typename A> + proto::expr< + proto::tag::subscript + , list2<expr &, typename result_of::as_child<A>::type> + , 2 + > const + operator [](A &a) + { + proto::expr< + proto::tag::subscript + , list2<expr &, typename result_of::as_child<A>::type> + , 2 + > that = {*this, proto::as_child(a)}; + return that; + } + + /// \overload + /// + template<typename A> + proto::expr< + proto::tag::subscript + , list2<expr &, typename result_of::as_child<A const>::type> + , 2 + > const + operator [](A const &a) + { + proto::expr< + proto::tag::subscript + , list2<expr &, typename result_of::as_child<A const>::type> + , 2 + > that = {*this, proto::as_child(a)}; + return that; + } + #endif + + /// Encodes the return type of \c expr\<\>::operator(), for use with \c boost::result_of\<\> + /// + template<typename Sig> + struct result + { + typedef typename result_of::funop<Sig, expr, default_domain>::type const type; + }; + + /// Function call + /// + /// \return A new \c expr\<\> node representing the function invocation of \c (*this)(). + proto::expr<proto::tag::function, list1<expr const &>, 1> const + operator ()() const + { + proto::expr<proto::tag::function, list1<expr const &>, 1> that = {*this}; + return that; + } + + #ifdef BOOST_PROTO_DEFINE_TERMINAL + /// \overload + /// + proto::expr<proto::tag::function, list1<expr &>, 1> const + operator ()() + { + proto::expr<proto::tag::function, list1<expr &>, 1> that = {*this}; + return that; + } + #endif + +#define BOOST_PP_ITERATION_PARAMS_2 (3, (1, BOOST_PP_DEC(BOOST_PROTO_MAX_FUNCTION_CALL_ARITY), <boost/proto/detail/expr1.hpp>)) +#include BOOST_PP_ITERATE() + }; + +#undef ARG_COUNT diff --git a/3rdParty/Boost/src/boost/proto/detail/expr1.hpp b/3rdParty/Boost/src/boost/proto/detail/expr1.hpp new file mode 100644 index 0000000..ee50dd3 --- /dev/null +++ b/3rdParty/Boost/src/boost/proto/detail/expr1.hpp @@ -0,0 +1,47 @@ +/////////////////////////////////////////////////////////////////////////////// +// expr1.hpp +// Contains definition of expr\<\>::operator() overloads. +// +// Copyright 2008 Eric Niebler. 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 +#error Do not include this file directly +#endif + +#define N BOOST_PP_ITERATION() + + /// \overload + /// + template<BOOST_PP_ENUM_PARAMS(N, typename A)> + typename result_of::BOOST_PP_CAT(funop, N)< + expr const + , default_domain BOOST_PP_ENUM_TRAILING_PARAMS(N, const A) + >::type const + operator ()(BOOST_PP_ENUM_BINARY_PARAMS(N, A, const &a)) const + { + return result_of::BOOST_PP_CAT(funop, N)< + expr const + , default_domain BOOST_PP_ENUM_TRAILING_PARAMS(N, const A) + >::call(*this BOOST_PP_ENUM_TRAILING_PARAMS(N, a)); + } + + #ifdef BOOST_PROTO_DEFINE_TERMINAL + /// \overload + /// + template<BOOST_PP_ENUM_PARAMS(N, typename A)> + typename result_of::BOOST_PP_CAT(funop, N)< + expr + , default_domain BOOST_PP_ENUM_TRAILING_PARAMS(N, const A) + >::type const + operator ()(BOOST_PP_ENUM_BINARY_PARAMS(N, A, const &a)) + { + return result_of::BOOST_PP_CAT(funop, N)< + expr + , default_domain BOOST_PP_ENUM_TRAILING_PARAMS(N, const A) + >::call(*this BOOST_PP_ENUM_TRAILING_PARAMS(N, a)); + } + #endif + +#undef N diff --git a/3rdParty/Boost/src/boost/proto/detail/funop.hpp b/3rdParty/Boost/src/boost/proto/detail/funop.hpp new file mode 100644 index 0000000..c6db023 --- /dev/null +++ b/3rdParty/Boost/src/boost/proto/detail/funop.hpp @@ -0,0 +1,64 @@ +/////////////////////////////////////////////////////////////////////////////// +// funop.hpp +// Contains definition of funop[n]\<\> class template. +// +// Copyright 2008 Eric Niebler. 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 +#error Do not include this file directly +#endif + +#define M0(Z, N, DATA) \ + typename proto::result_of::as_child<BOOST_PP_CAT(A, N), Domain>::type \ + /**/ + +#define M1(Z, N, DATA) \ + proto::as_child<Domain>(BOOST_PP_CAT(a, N)) \ + /**/ + + /// \brief A helper metafunction for computing the + /// return type of \c proto::expr\<\>::operator(). + template<typename Expr, typename Domain BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_ITERATION(), typename A)> + struct BOOST_PP_CAT(funop, BOOST_PP_ITERATION()) + { + typedef proto::expr< + tag::function + , BOOST_PP_CAT(list, BOOST_PP_INC(BOOST_PP_ITERATION()))< + Expr & + BOOST_PP_ENUM_TRAILING(BOOST_PP_ITERATION(), M0, ~) + > + , BOOST_PP_INC(BOOST_PP_ITERATION()) + > type; + + static type const call( + Expr &e + BOOST_PP_ENUM_TRAILING_BINARY_PARAMS(BOOST_PP_ITERATION(), A, &a) + ) + { + type that = { + e + BOOST_PP_ENUM_TRAILING(BOOST_PP_ITERATION(), M1, ~) + }; + return that; + } + }; + + /// \brief A helper metafunction for computing the + /// return type of \c proto::expr\<\>::operator(). + template<typename Expr BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_ITERATION(), typename A), typename This, typename Domain> + struct funop<Expr(BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(), A)), This, Domain> + : BOOST_PP_CAT(funop, BOOST_PP_ITERATION())< + typename detail::same_cv<Expr, This>::type + , Domain + BOOST_PP_ENUM_TRAILING_BINARY_PARAMS( + BOOST_PP_ITERATION() + , typename remove_reference<A + , >::type BOOST_PP_INTERCEPT + ) + > + {}; + +#undef M0 +#undef M1 diff --git a/3rdParty/Boost/src/boost/proto/detail/ignore_unused.hpp b/3rdParty/Boost/src/boost/proto/detail/ignore_unused.hpp new file mode 100644 index 0000000..18182cc --- /dev/null +++ b/3rdParty/Boost/src/boost/proto/detail/ignore_unused.hpp @@ -0,0 +1,23 @@ +/////////////////////////////////////////////////////////////////////////////// +/// \file ignore_unused.hpp +/// Definintion of ignore_unused, a dummy function for suppressing compiler +/// warnings +// +// Copyright 2008 Eric Niebler. 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_PROTO_DETAIL_IGNORE_UNUSED_HPP_EAN_03_03_2008 +#define BOOST_PROTO_DETAIL_IGNORE_UNUSED_HPP_EAN_03_03_2008 + +namespace boost { namespace proto +{ + namespace detail + { + template<typename T> + inline void ignore_unused(T const &) + {} + } +}} + +#endif diff --git a/3rdParty/Boost/src/boost/proto/detail/local.hpp b/3rdParty/Boost/src/boost/proto/detail/local.hpp new file mode 100644 index 0000000..8886bbb --- /dev/null +++ b/3rdParty/Boost/src/boost/proto/detail/local.hpp @@ -0,0 +1,52 @@ +/////////////////////////////////////////////////////////////////////////////// +/// \file local.hpp +/// Contains macros to ease the generation of repetitious code constructs +// +// Copyright 2008 Eric Niebler. 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_PROTO_LOCAL_MACRO +# error "local iteration target macro is not defined" +#endif + +#ifndef BOOST_PROTO_LOCAL_LIMITS +# define BOOST_PROTO_LOCAL_LIMITS (1, BOOST_PROTO_MAX_ARITY) +#endif + +#ifndef BOOST_PROTO_LOCAL_typename_A +# define BOOST_PROTO_LOCAL_typename_A BOOST_PROTO_typename_A +#endif + +#ifndef BOOST_PROTO_LOCAL_A +# define BOOST_PROTO_LOCAL_A BOOST_PROTO_A_const_ref +#endif + +#ifndef BOOST_PROTO_LOCAL_A_a +# define BOOST_PROTO_LOCAL_A_a BOOST_PROTO_A_const_ref_a +#endif + +#ifndef BOOST_PROTO_LOCAL_a +# define BOOST_PROTO_LOCAL_a BOOST_PROTO_ref_a +#endif + +#define BOOST_PP_LOCAL_LIMITS BOOST_PROTO_LOCAL_LIMITS + +#define BOOST_PP_LOCAL_MACRO(N) \ + BOOST_PROTO_LOCAL_MACRO( \ + N \ + , BOOST_PROTO_LOCAL_typename_A \ + , BOOST_PROTO_LOCAL_A \ + , BOOST_PROTO_LOCAL_A_a \ + , BOOST_PROTO_LOCAL_a \ + ) \ + /**/ + +#include BOOST_PP_LOCAL_ITERATE() + +#undef BOOST_PROTO_LOCAL_MACRO +#undef BOOST_PROTO_LOCAL_LIMITS +#undef BOOST_PROTO_LOCAL_typename_A +#undef BOOST_PROTO_LOCAL_A +#undef BOOST_PROTO_LOCAL_A_a +#undef BOOST_PROTO_LOCAL_a diff --git a/3rdParty/Boost/src/boost/proto/detail/poly_function.hpp b/3rdParty/Boost/src/boost/proto/detail/poly_function.hpp new file mode 100644 index 0000000..346bc14 --- /dev/null +++ b/3rdParty/Boost/src/boost/proto/detail/poly_function.hpp @@ -0,0 +1,297 @@ +#ifndef BOOST_PP_IS_ITERATING + /////////////////////////////////////////////////////////////////////////////// + /// \file poly_function.hpp + /// A wrapper that makes a tr1-style function object that handles const + /// and non-const refs and reference_wrapper arguments, too, and forwards + /// the arguments on to the specified implementation. + // + // Copyright 2008 Eric Niebler. 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_PROTO_DETAIL_POLY_FUNCTION_EAN_2008_05_02 + #define BOOST_PROTO_DETAIL_POLY_FUNCTION_EAN_2008_05_02 + + #include <boost/ref.hpp> + #include <boost/mpl/bool.hpp> + #include <boost/mpl/void.hpp> + #include <boost/mpl/size_t.hpp> + #include <boost/mpl/eval_if.hpp> + #include <boost/preprocessor/cat.hpp> + #include <boost/preprocessor/facilities/intercept.hpp> + #include <boost/preprocessor/iteration/iterate.hpp> + #include <boost/preprocessor/repetition/enum.hpp> + #include <boost/preprocessor/repetition/enum_params.hpp> + #include <boost/preprocessor/repetition/enum_trailing_params.hpp> + #include <boost/preprocessor/repetition/enum_binary_params.hpp> + #include <boost/proto/proto_fwd.hpp> + + #ifdef _MSC_VER + # pragma warning(push) + # pragma warning(disable: 4181) // const applied to reference type + #endif + + namespace boost { namespace proto { namespace detail + { + + //////////////////////////////////////////////////////////////////////////////////////////////// + template<typename T> + struct normalize_arg + { + typedef T type; + typedef T const &reference; + }; + + template<typename T> + struct normalize_arg<T &> + { + typedef T type; + typedef T const &reference; + }; + + template<typename T> + struct normalize_arg<T const &> + { + typedef T type; + typedef T const &reference; + }; + + template<typename T> + struct normalize_arg<boost::reference_wrapper<T> > + { + typedef T &type; + typedef T &reference; + }; + + template<typename T> + struct normalize_arg<boost::reference_wrapper<T> &> + { + typedef T &type; + typedef T &reference; + }; + + template<typename T> + struct normalize_arg<boost::reference_wrapper<T> const &> + { + typedef T &type; + typedef T &reference; + }; + + //////////////////////////////////////////////////////////////////////////////////////////////// + template<typename T> + struct arg + { + typedef T const &type; + + arg(type t) + : value(t) + {} + + operator type() const + { + return this->value; + } + + type operator()() const + { + return *this; + } + + private: + arg &operator =(arg const &); + type value; + }; + + template<typename T> + struct arg<T &> + { + typedef T &type; + + arg(type t) + : value(t) + {} + + operator type() const + { + return this->value; + } + + type operator()() const + { + return *this; + } + + private: + arg &operator =(arg const &); + type value; + }; + + //////////////////////////////////////////////////////////////////////////////////////////////// + template<typename T, typename Void = void> + struct is_poly_function + : mpl::false_ + {}; + + template<typename T> + struct is_poly_function<T, typename T::is_poly_function_base_> + : mpl::true_ + {}; + + //////////////////////////////////////////////////////////////////////////////////////////////// + #define BOOST_PROTO_POLY_FUNCTION() \ + typedef void is_poly_function_base_; \ + /**/ + + //////////////////////////////////////////////////////////////////////////////////////////////// + struct poly_function_base + { + /// INTERNAL ONLY + BOOST_PROTO_POLY_FUNCTION() + }; + + //////////////////////////////////////////////////////////////////////////////////////////////// + template<typename Derived, typename NullaryResult = void> + struct poly_function + : poly_function_base + { + template<typename Sig> + struct result; + + template<typename This> + struct result<This()> + : Derived::template impl<> + { + typedef typename result::result_type type; + }; + + NullaryResult operator()() const + { + result<Derived const()> impl; + return impl(); + } + + #define BOOST_PP_ITERATION_PARAMS_1 (4, (1, BOOST_PROTO_MAX_ARITY, <boost/proto/detail/poly_function.hpp>, 0)) + #include BOOST_PP_ITERATE() + }; + + template<typename T> + struct wrap_t; + + typedef char poly_function_t; + typedef char (&mono_function_t)[2]; + typedef char (&unknown_function_t)[3]; + + template<typename T> poly_function_t test_poly_function(T *, wrap_t<typename T::is_poly_function_base_> * = 0); + template<typename T> mono_function_t test_poly_function(T *, wrap_t<typename T::result_type> * = 0); + template<typename T> unknown_function_t test_poly_function(T *, ...); + + //////////////////////////////////////////////////////////////////////////////////////////////// + template<typename Fun, typename Sig, typename Switch = mpl::size_t<sizeof(test_poly_function<Fun>(0,0))> > + struct poly_function_traits + { + typedef typename Fun::template result<Sig>::type result_type; + typedef Fun function_type; + }; + + //////////////////////////////////////////////////////////////////////////////////////////////// + template<typename Fun, typename Sig> + struct poly_function_traits<Fun, Sig, mpl::size_t<sizeof(mono_function_t)> > + { + typedef typename Fun::result_type result_type; + typedef Fun function_type; + }; + + //////////////////////////////////////////////////////////////////////////////////////////////// + template<typename PolyFunSig, bool IsPolyFunction> + struct as_mono_function_impl; + + //////////////////////////////////////////////////////////////////////////////////////////////// + template<typename PolyFunSig> + struct as_mono_function; + + #define BOOST_PP_ITERATION_PARAMS_1 (4, (1, BOOST_PROTO_MAX_ARITY, <boost/proto/detail/poly_function.hpp>, 1)) + #include BOOST_PP_ITERATE() + + }}} // namespace boost::proto::detail + + #ifdef _MSC_VER + # pragma warning(pop) + #endif + + #endif + +#elif 0 == BOOST_PP_ITERATION_FLAGS() + + #define N BOOST_PP_ITERATION() + + template<typename This BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)> + struct result<This(BOOST_PP_ENUM_PARAMS(N, A))> + : Derived::template impl< + BOOST_PP_ENUM_BINARY_PARAMS( + N + , typename normalize_arg<A + , >::type BOOST_PP_INTERCEPT + ) + > + { + typedef typename result::result_type type; + }; + + template<BOOST_PP_ENUM_PARAMS(N, typename A)> + typename result< + Derived const( + BOOST_PP_ENUM_BINARY_PARAMS(N, A, const & BOOST_PP_INTERCEPT) + ) + >::type + operator ()(BOOST_PP_ENUM_BINARY_PARAMS(N, A, const &a)) const + { + result< + Derived const( + BOOST_PP_ENUM_BINARY_PARAMS(N, A, const & BOOST_PP_INTERCEPT) + ) + > impl; + + #define M0(Z, N, DATA) \ + static_cast<typename normalize_arg<BOOST_PP_CAT(A, N) const &> \ + ::reference>(BOOST_PP_CAT(a, N)) + return impl(BOOST_PP_ENUM(N, M0, ~)); + #undef M0 + } + + #undef N + +#elif 1 == BOOST_PP_ITERATION_FLAGS() + + #define N BOOST_PP_ITERATION() + + //////////////////////////////////////////////////////////////////////////////////////////////// + template<typename PolyFun BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)> + struct poly_function_traits<PolyFun, PolyFun(BOOST_PP_ENUM_PARAMS(N, A)), mpl::size_t<sizeof(poly_function_t)> > + { + typedef typename PolyFun::template impl<BOOST_PP_ENUM_PARAMS(N, const A)> function_type; + typedef typename function_type::result_type result_type; + }; + + //////////////////////////////////////////////////////////////////////////////////////////////// + template<typename PolyFun BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)> + struct as_mono_function_impl<PolyFun(BOOST_PP_ENUM_PARAMS(N, A)), true> + { + typedef typename PolyFun::template impl<BOOST_PP_ENUM_PARAMS(N, const A)> type; + }; + + //////////////////////////////////////////////////////////////////////////////////////////////// + template<typename PolyFun BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)> + struct as_mono_function_impl<PolyFun(BOOST_PP_ENUM_PARAMS(N, A)), false> + { + typedef PolyFun type; + }; + + //////////////////////////////////////////////////////////////////////////////////////////////// + template<typename PolyFun BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)> + struct as_mono_function<PolyFun(BOOST_PP_ENUM_PARAMS(N, A))> + : as_mono_function_impl<PolyFun(BOOST_PP_ENUM_PARAMS(N, A)), is_poly_function<PolyFun>::value> + {}; + + #undef N + +#endif |