Change the result_of behaviour with BOOST_RESULT_OF_USE_DECLTYPE

to make consistency between boost::result_of.
This commit is contained in:
Kohei Takahashi
2014-11-02 02:55:26 +09:00
parent 7ef4b03249
commit 0a13aa5ee4
2 changed files with 11 additions and 5 deletions

View File

@ -7,8 +7,14 @@
#if !defined(FUSION_RESULT_OF_10272014_0654)
#define FUSION_RESULT_OF_10272014_0654
#include <boost/config.hpp>
#include <boost/utility/result_of.hpp>
#if !(defined(BOOST_NO_CXX11_DECLTYPE) || defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES))
#if !defined(BOOST_RESULT_OF_USE_DECLTYPE) || defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
#define BOOST_FUSION_NO_DECLTYPE_BASED_RESULT_OF
#endif
#if !defined(BOOST_FUSION_NO_DECLTYPE_BASED_RESULT_OF)
#include <boost/mpl/if.hpp>
#include <boost/mpl/or.hpp>
#include <boost/mpl/has_xxx.hpp>
@ -21,12 +27,12 @@ namespace boost { namespace fusion { namespace detail
// 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) || defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
#if defined(BOOST_FUSION_NO_DECLTYPE_BASED_RESULT_OF)
template <typename Sig>
struct result_of_with_decltype : boost::tr1_result_of<Sig> {};
#else
#else // defined(BOOST_FUSION_NO_DECLTYPE_BASED_RESULT_OF)
BOOST_MPL_HAS_XXX_TRAIT_DEF(result_type)
BOOST_MPL_HAS_XXX_TEMPLATE_DEF(result)
@ -40,7 +46,7 @@ namespace boost { namespace fusion { namespace detail
boost::tr1_result_of<F(Args...)>,
boost::detail::cpp0x_result_of<F(Args...)> >::type {};
#endif
#endif // defined(BOOST_FUSION_NO_DECLTYPE_BASED_RESULT_OF)
}}}

View File

@ -238,7 +238,7 @@ main()
}
{
#if !defined(BOOST_NO_CXX11_DECLTYPE)
#if !defined(BOOST_FUSION_NO_DECLTYPE_BASED_RESULT_OF)
{
boost::fusion::vector<int, double, long> container{1, 2, 3};
functor f;