diff options
author | Kevin Smith <git@kismith.co.uk> | 2012-08-02 20:41:55 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2012-08-02 21:03:09 (GMT) |
commit | d5ace22054203c7989691ae8b3fa4e4784d1b57e (patch) | |
tree | 64d400cdb10644967df183d0f202fcbf8160a773 /3rdParty/Boost/src/boost/utility | |
parent | 6f26d9aa86f0909af13b23b1a925b8d492e74154 (diff) | |
download | swift-contrib-ks/boost1.47.zip swift-contrib-ks/boost1.47.tar.bz2 |
Add two extra Boost dependencies, upgrade to 1.47.0ks/boost1.47
Diffstat (limited to '3rdParty/Boost/src/boost/utility')
-rw-r--r-- | 3rdParty/Boost/src/boost/utility/detail/result_of_iterate.hpp | 148 | ||||
-rw-r--r-- | 3rdParty/Boost/src/boost/utility/result_of.hpp | 100 |
2 files changed, 248 insertions, 0 deletions
diff --git a/3rdParty/Boost/src/boost/utility/detail/result_of_iterate.hpp b/3rdParty/Boost/src/boost/utility/detail/result_of_iterate.hpp new file mode 100644 index 0000000..035bf19 --- /dev/null +++ b/3rdParty/Boost/src/boost/utility/detail/result_of_iterate.hpp @@ -0,0 +1,148 @@ +// Boost result_of library + +// Copyright Douglas Gregor 2004. Use, modification and +// distribution is subject to 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) + +// For more information, see http://www.boost.org/libs/utility +#if !defined(BOOST_PP_IS_ITERATING) +# error Boost result_of - do not include this file! +#endif + +// CWPro8 requires an argument in a function type specialization +#if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3002)) && BOOST_PP_ITERATION() == 0 +# define BOOST_RESULT_OF_ARGS void +#else +# define BOOST_RESULT_OF_ARGS BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),T) +#endif + +#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551)) +template<typename F BOOST_PP_COMMA_IF(BOOST_PP_ITERATION()) + BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),typename T)> +struct tr1_result_of<F(BOOST_RESULT_OF_ARGS)> + : mpl::if_< + mpl::or_< is_pointer<F>, is_member_function_pointer<F> > + , boost::detail::tr1_result_of_impl< + typename remove_cv<F>::type, + typename remove_cv<F>::type(BOOST_RESULT_OF_ARGS), + (boost::detail::has_result_type<F>::value)> + , boost::detail::tr1_result_of_impl< + F, + F(BOOST_RESULT_OF_ARGS), + (boost::detail::has_result_type<F>::value)> >::type { }; +#endif + +#if !defined(BOOST_NO_DECLTYPE) && defined(BOOST_RESULT_OF_USE_DECLTYPE) + +// As of N2588, C++0x result_of only supports function call +// expressions of the form f(x). This precludes support for member +// function pointers, which are invoked with expressions of the form +// o->*f(x). This implementation supports both. +template<typename F BOOST_PP_COMMA_IF(BOOST_PP_ITERATION()) + BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),typename T)> +struct result_of<F(BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),T))> + : mpl::if_< + mpl::or_< is_pointer<F>, is_member_function_pointer<F> > + , detail::tr1_result_of_impl< + typename remove_cv<F>::type, + typename remove_cv<F>::type(BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),T)), false + > + , detail::cpp0x_result_of_impl< + F(BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),T)) + > + >::type +{}; + +namespace detail { + +# define BOOST_RESULT_OF_STATIC_MEMBERS(z, n, _) \ + static T ## n t ## n; \ + /**/ + +template<typename F BOOST_PP_COMMA_IF(BOOST_PP_ITERATION()) + BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),typename T)> +class cpp0x_result_of_impl<F(BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),T))> +{ + static F f; + BOOST_PP_REPEAT(BOOST_PP_ITERATION(), BOOST_RESULT_OF_STATIC_MEMBERS, _) +public: + typedef decltype(f(BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),t))) type; +}; + +} // namespace detail + +#else // defined(BOOST_NO_DECLTYPE) + +#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551)) +template<typename F BOOST_PP_COMMA_IF(BOOST_PP_ITERATION()) + BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),typename T)> +struct result_of<F(BOOST_RESULT_OF_ARGS)> + : tr1_result_of<F(BOOST_RESULT_OF_ARGS)> { }; +#endif + +#endif // defined(BOOST_NO_DECLTYPE) + +#undef BOOST_RESULT_OF_ARGS + +#if BOOST_PP_ITERATION() >= 1 + +namespace detail { + +template<typename R, typename FArgs BOOST_PP_COMMA_IF(BOOST_PP_ITERATION()) + BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),typename T)> +struct tr1_result_of_impl<R (*)(BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),T)), FArgs, false> +{ + typedef R type; +}; + +template<typename R, typename FArgs BOOST_PP_COMMA_IF(BOOST_PP_ITERATION()) + BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),typename T)> +struct tr1_result_of_impl<R (&)(BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),T)), FArgs, false> +{ + typedef R type; +}; + +#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551)) +template<typename R, typename FArgs BOOST_PP_COMMA_IF(BOOST_PP_ITERATION()) + BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),typename T)> +struct tr1_result_of_impl<R (T0::*) + (BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PP_ITERATION(),T)), + FArgs, false> +{ + typedef R type; +}; + +template<typename R, typename FArgs BOOST_PP_COMMA_IF(BOOST_PP_ITERATION()) + BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),typename T)> +struct tr1_result_of_impl<R (T0::*) + (BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PP_ITERATION(),T)) + const, + FArgs, false> +{ + typedef R type; +}; + +template<typename R, typename FArgs BOOST_PP_COMMA_IF(BOOST_PP_ITERATION()) + BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),typename T)> +struct tr1_result_of_impl<R (T0::*) + (BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PP_ITERATION(),T)) + volatile, + FArgs, false> +{ + typedef R type; +}; + +template<typename R, typename FArgs BOOST_PP_COMMA_IF(BOOST_PP_ITERATION()) + BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),typename T)> +struct tr1_result_of_impl<R (T0::*) + (BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PP_ITERATION(),T)) + const volatile, + FArgs, false> +{ + typedef R type; +}; +#endif + +} +#endif diff --git a/3rdParty/Boost/src/boost/utility/result_of.hpp b/3rdParty/Boost/src/boost/utility/result_of.hpp new file mode 100644 index 0000000..9a42fd2 --- /dev/null +++ b/3rdParty/Boost/src/boost/utility/result_of.hpp @@ -0,0 +1,100 @@ +// Boost result_of library + +// Copyright Douglas Gregor 2004. Use, modification and +// distribution is subject to 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) + +// For more information, see http://www.boost.org/libs/utility +#ifndef BOOST_RESULT_OF_HPP +#define BOOST_RESULT_OF_HPP + +#include <boost/config.hpp> +#include <boost/preprocessor/iteration/iterate.hpp> +#include <boost/preprocessor/punctuation/comma_if.hpp> +#include <boost/preprocessor/repetition/enum_params.hpp> +#include <boost/preprocessor/repetition/enum_shifted_params.hpp> +#include <boost/detail/workaround.hpp> +#include <boost/mpl/has_xxx.hpp> +#include <boost/mpl/if.hpp> +#include <boost/mpl/bool.hpp> +#include <boost/mpl/or.hpp> +#include <boost/type_traits/is_pointer.hpp> +#include <boost/type_traits/is_member_function_pointer.hpp> +#include <boost/type_traits/remove_cv.hpp> + +#ifndef BOOST_RESULT_OF_NUM_ARGS +# define BOOST_RESULT_OF_NUM_ARGS 10 +#endif + +namespace boost { + +template<typename F> struct result_of; +template<typename F> struct tr1_result_of; // a TR1-style implementation of result_of + +#if !defined(BOOST_NO_SFINAE) && !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) +namespace detail { + +BOOST_MPL_HAS_XXX_TRAIT_DEF(result_type) + +template<typename F, typename FArgs, bool HasResultType> struct tr1_result_of_impl; +template<typename F> struct cpp0x_result_of_impl; + +template<typename F> +struct result_of_void_impl +{ + typedef void type; +}; + +template<typename R> +struct result_of_void_impl<R (*)(void)> +{ + typedef R type; +}; + +template<typename R> +struct result_of_void_impl<R (&)(void)> +{ + typedef R type; +}; + +// Determine the return type of a function pointer or pointer to member. +template<typename F, typename FArgs> +struct result_of_pointer + : tr1_result_of_impl<typename remove_cv<F>::type, FArgs, false> { }; + +template<typename F, typename FArgs> +struct tr1_result_of_impl<F, FArgs, true> +{ + typedef typename F::result_type type; +}; + +template<typename FArgs> +struct is_function_with_no_args : mpl::false_ {}; + +template<typename F> +struct is_function_with_no_args<F(void)> : mpl::true_ {}; + +template<typename F, typename FArgs> +struct result_of_nested_result : F::template result<FArgs> +{}; + +template<typename F, typename FArgs> +struct tr1_result_of_impl<F, FArgs, false> + : mpl::if_<is_function_with_no_args<FArgs>, + result_of_void_impl<F>, + result_of_nested_result<F, FArgs> >::type +{}; + +} // end namespace detail + +#define BOOST_PP_ITERATION_PARAMS_1 (3,(0,BOOST_RESULT_OF_NUM_ARGS,<boost/utility/detail/result_of_iterate.hpp>)) +#include BOOST_PP_ITERATE() + +#else +# define BOOST_NO_RESULT_OF 1 +#endif + +} + +#endif // BOOST_RESULT_OF_HPP |