Ticket #6755: result_of.patch

File result_of.patch, 2.0 KB (added by Michel Morin, 11 years ago)

This patch fixes the inconsistency. This patch also fixes the test so that the patched result_of passes the test. BOOST_STATIC_ASSERT((is_same<result_of<func_ptr(void)>::type, int>::value)); is removed, since this is uncallable. (BOOST_STATIC_ASSERT((is_same<tr1_result_of<func_ptr(void)>::type, int>::value)); is kept untouched.)

  • boost/utility/detail/result_of_iterate.hpp

     
    4040         BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),typename T)>
    4141struct result_of<F(BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),T))>
    4242    : mpl::if_<
    43           mpl::or_< is_pointer<F>, is_member_function_pointer<F> >
     43          is_member_function_pointer<F>
    4444        , detail::tr1_result_of_impl<
    4545            typename remove_cv<F>::type,
    4646            typename remove_cv<F>::type(BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),T)), false
  • libs/utility/test/result_of_test.cpp

     
    193193  BOOST_STATIC_ASSERT((is_same<result_of<mem_func_ptr_v(X,char)>::type, int>::value));
    194194  BOOST_STATIC_ASSERT((is_same<result_of<mem_func_ptr_cv(X,char)>::type, int>::value));
    195195  BOOST_STATIC_ASSERT((is_same<result_of<mem_func_ptr_0(X)>::type, int>::value));
    196   BOOST_STATIC_ASSERT((is_same<result_of<func_ptr(void)>::type, int>::value));
    197196
    198197  BOOST_STATIC_ASSERT((is_same<tr1_result_of<func_ptr(char, float)>::type, int>::value));
    199198  BOOST_STATIC_ASSERT((is_same<tr1_result_of<func_ref(char, float)>::type, int>::value));
     
    205204  BOOST_STATIC_ASSERT((is_same<tr1_result_of<mem_func_ptr_cv(X,char)>::type, int>::value));
    206205  BOOST_STATIC_ASSERT((is_same<tr1_result_of<mem_func_ptr_0(X)>::type, int>::value));
    207206  BOOST_STATIC_ASSERT((is_same<tr1_result_of<func_ptr(void)>::type, int>::value));
     207  BOOST_STATIC_ASSERT((is_same<tr1_result_of<func_ref(void)>::type, int>::value));
    208208
    209209  BOOST_STATIC_ASSERT((is_same<result_of<result_of_member_function_template(double)>::type, double>::value));
    210210  BOOST_STATIC_ASSERT((is_same<result_of<const result_of_member_function_template(double)>::type, const double>::value));