diff --git a/include/boost/fusion/algorithm/iteration/detail/fold.hpp b/include/boost/fusion/algorithm/iteration/detail/fold.hpp index afa99026..1813bd24 100644 --- a/include/boost/fusion/algorithm/iteration/detail/fold.hpp +++ b/include/boost/fusion/algorithm/iteration/detail/fold.hpp @@ -47,7 +47,7 @@ namespace boost { namespace fusion { template struct BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME, _lvalue_state) - : boost::tr1_result_of< + : fusion::detail::result_of_with_decltype< F( typename add_reference::type>::type, BOOST_FUSION_FOLD_IMPL_INVOKE_IT_META_TRANSFORM(It)) @@ -327,7 +327,7 @@ namespace boost { namespace fusion { typedef typename BOOST_PP_CAT(result_of_unrolled_,BOOST_FUSION_FOLD_NAME)< - typename boost::tr1_result_of< + typename fusion::detail::result_of_with_decltype< F( StateRef, BOOST_FUSION_FOLD_IMPL_INVOKE_IT_META_TRANSFORM( diff --git a/include/boost/fusion/algorithm/iteration/detail/preprocessed/fold.hpp b/include/boost/fusion/algorithm/iteration/detail/preprocessed/fold.hpp index 5456a0d7..bd3b1dbd 100644 --- a/include/boost/fusion/algorithm/iteration/detail/preprocessed/fold.hpp +++ b/include/boost/fusion/algorithm/iteration/detail/preprocessed/fold.hpp @@ -14,7 +14,7 @@ namespace boost { namespace fusion { template struct fold_lvalue_state - : boost::result_of< + : fusion::detail::result_of_with_decltype< F( typename add_reference::type>::type, typename fusion::result_of::deref::type) @@ -273,7 +273,7 @@ namespace boost { namespace fusion { typedef typename result_of_unrolled_fold< - typename boost::tr1_result_of< + typename fusion::detail::result_of_with_decltype< F( StateRef, typename fusion::result_of::deref< It0 const>::type diff --git a/include/boost/fusion/algorithm/iteration/fold.hpp b/include/boost/fusion/algorithm/iteration/fold.hpp index a83b33b1..a2a0146a 100644 --- a/include/boost/fusion/algorithm/iteration/fold.hpp +++ b/include/boost/fusion/algorithm/iteration/fold.hpp @@ -10,6 +10,7 @@ #define BOOST_FUSION_ALGORITHM_ITERATION_FOLD_HPP #include +#include #include #include #include diff --git a/include/boost/fusion/support/detail/result_of.hpp b/include/boost/fusion/support/detail/result_of.hpp new file mode 100644 index 00000000..e15fea5e --- /dev/null +++ b/include/boost/fusion/support/detail/result_of.hpp @@ -0,0 +1,42 @@ +/*============================================================================= + Copyright (c) 2001-2014 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) +==============================================================================*/ +#if !defined(FUSION_RESULT_OF_10272014_0654) +#define FUSION_RESULT_OF_10272014_0654 + +#include + +namespace boost { namespace fusion { namespace detail +{ + // This is a temporary workaround for result_of before we make fusion fully + // sfinae result_of friendy, which will require some heavy lifting for some + // low level code. So far this is used only in the fold algorithm. This will + // be removed once we overhaul fold. + +#if defined(BOOST_NO_CXX11_DECLTYPE) + + template + struct result_of_with_decltype : boost::tr1_result_of {}; + +#else + + BOOST_MPL_HAS_XXX_TRAIT_DEF(result_type) + BOOST_MPL_HAS_XXX_TEMPLATE_DEF(result) + + template + struct result_of_with_decltype; + + template + struct result_of_with_decltype + : mpl::if_, detail::has_result>, + boost::tr1_result_of, + boost::detail::cpp0x_result_of>::type {}; + +#endif + +}}} + +#endif