Ticket #5098: result_of.patch
File result_of.patch, 2.0 KB (added by , 12 years ago) |
---|
-
boost/utility/detail/result_of_iterate.hpp
56 56 57 57 namespace detail { 58 58 59 # define BOOST_RESULT_OF_STATIC_MEMBERS(z, n, _) \60 static T ## n t ## n; \61 /**/62 63 59 template<typename F BOOST_PP_COMMA_IF(BOOST_PP_ITERATION()) 64 60 BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),typename T)> 65 61 class cpp0x_result_of_impl<F(BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),T))> 66 62 { 67 static F f;68 BOOST_PP_REPEAT(BOOST_PP_ITERATION(), BOOST_RESULT_OF_STATIC_MEMBERS, _)63 template<typename S> 64 static typename add_rvalue_reference<S>::type declval(); 69 65 public: 70 typedef decltype(f(BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),t))) type; 66 typedef decltype( 67 declval<F>()( 68 BOOST_PP_ENUM_BINARY_PARAMS(BOOST_PP_ITERATION(), declval<T, >() BOOST_PP_INTERCEPT) 69 ) 70 ) type; 71 71 }; 72 72 73 73 } // namespace detail -
boost/utility/result_of.hpp
13 13 #include <boost/preprocessor/iteration/iterate.hpp> 14 14 #include <boost/preprocessor/punctuation/comma_if.hpp> 15 15 #include <boost/preprocessor/repetition/enum_params.hpp> 16 #include <boost/preprocessor/repetition/enum_binary_params.hpp> 16 17 #include <boost/preprocessor/repetition/enum_shifted_params.hpp> 18 #include <boost/preprocessor/facilities/intercept.hpp> 17 19 #include <boost/detail/workaround.hpp> 18 20 #include <boost/mpl/has_xxx.hpp> 19 21 #include <boost/mpl/if.hpp> … … 22 24 #include <boost/type_traits/is_pointer.hpp> 23 25 #include <boost/type_traits/is_member_function_pointer.hpp> 24 26 #include <boost/type_traits/remove_cv.hpp> 27 #include <boost/type_traits/add_rvalue_reference.hpp> 25 28 26 29 #ifndef BOOST_RESULT_OF_NUM_ARGS 27 30 # define BOOST_RESULT_OF_NUM_ARGS 10