forked from boostorg/fusion
Change the result_of behaviour with BOOST_RESULT_OF_USE_DECLTYPE
to make consistency between boost::result_of.
This commit is contained in:
@ -7,8 +7,14 @@
|
|||||||
#if !defined(FUSION_RESULT_OF_10272014_0654)
|
#if !defined(FUSION_RESULT_OF_10272014_0654)
|
||||||
#define FUSION_RESULT_OF_10272014_0654
|
#define FUSION_RESULT_OF_10272014_0654
|
||||||
|
|
||||||
|
#include <boost/config.hpp>
|
||||||
#include <boost/utility/result_of.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/if.hpp>
|
||||||
#include <boost/mpl/or.hpp>
|
#include <boost/mpl/or.hpp>
|
||||||
#include <boost/mpl/has_xxx.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
|
// low level code. So far this is used only in the fold algorithm. This will
|
||||||
// be removed once we overhaul fold.
|
// 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>
|
template <typename Sig>
|
||||||
struct result_of_with_decltype : boost::tr1_result_of<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_TRAIT_DEF(result_type)
|
||||||
BOOST_MPL_HAS_XXX_TEMPLATE_DEF(result)
|
BOOST_MPL_HAS_XXX_TEMPLATE_DEF(result)
|
||||||
@ -40,7 +46,7 @@ namespace boost { namespace fusion { namespace detail
|
|||||||
boost::tr1_result_of<F(Args...)>,
|
boost::tr1_result_of<F(Args...)>,
|
||||||
boost::detail::cpp0x_result_of<F(Args...)> >::type {};
|
boost::detail::cpp0x_result_of<F(Args...)> >::type {};
|
||||||
|
|
||||||
#endif
|
#endif // defined(BOOST_FUSION_NO_DECLTYPE_BASED_RESULT_OF)
|
||||||
|
|
||||||
}}}
|
}}}
|
||||||
|
|
||||||
|
@ -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};
|
boost::fusion::vector<int, double, long> container{1, 2, 3};
|
||||||
functor f;
|
functor f;
|
||||||
|
Reference in New Issue
Block a user