// 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 struct tr1_result_of : mpl::if_< mpl::or_< is_pointer, is_member_function_pointer > , boost::detail::tr1_result_of_impl< typename remove_cv::type, typename remove_cv::type(BOOST_RESULT_OF_ARGS), (boost::detail::has_result_type::value)> , boost::detail::tr1_result_of_impl< F, F(BOOST_RESULT_OF_ARGS), (boost::detail::has_result_type::value)> >::type { }; #endif #if !defined(BOOST_NO_DECLTYPE) && defined(BOOST_RESULT_OF_USE_DECLTYPE) // Uses declval following N3225 20.7.7.6 when F is not a pointer. template struct result_of : mpl::if_< mpl::or_< is_pointer, is_member_function_pointer > , detail::tr1_result_of_impl< typename remove_cv::type, typename remove_cv::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 { template struct cpp0x_result_of_impl { typedef decltype( boost::declval()( BOOST_PP_ENUM_BINARY_PARAMS(BOOST_PP_ITERATION(), declval() BOOST_PP_INTERCEPT) ) ) type; }; } // namespace detail #else // defined(BOOST_NO_DECLTYPE) #if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551)) template struct result_of : tr1_result_of { }; #endif #endif // defined(BOOST_NO_DECLTYPE) #undef BOOST_RESULT_OF_ARGS #if BOOST_PP_ITERATION() >= 1 namespace detail { template struct tr1_result_of_impl { typedef R type; }; template struct tr1_result_of_impl { typedef R type; }; #if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551)) template struct tr1_result_of_impl { typedef R type; }; template struct tr1_result_of_impl { typedef R type; }; template struct tr1_result_of_impl { typedef R type; }; template struct tr1_result_of_impl { typedef R type; }; #endif } #endif