Changeset 80654
 Timestamp:
 Sep 23, 2012, 1:11:00 AM (6 years ago)
 Location:
 trunk/boost/utility
 Files:

 2 edited
Legend:
 Unmodified
 Added
 Removed

trunk/boost/utility/detail/result_of_iterate.hpp
r80636 r80654 57 57 namespace detail { 58 58 59 #ifdef BOOST_ NO_SFINAE_EXPR60 61 template<typename F> 62 struct BOOST_PP_CAT(result_of_ is_callable_fun_2_, BOOST_PP_ITERATION());59 #ifdef BOOST_RESULT_OF_NO_SFINAE_EXPR 60 61 template<typename F> 62 struct BOOST_PP_CAT(result_of_callable_fun_2_, BOOST_PP_ITERATION()); 63 63 64 64 template<typename R BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_ITERATION(), typename T)> 65 struct BOOST_PP_CAT(result_of_ is_callable_fun_2_, BOOST_PP_ITERATION())<R(BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(), T))> {65 struct BOOST_PP_CAT(result_of_callable_fun_2_, BOOST_PP_ITERATION())<R(BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(), T))> { 66 66 R operator()(BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(), T)) const; 67 67 typedef result_of_private_type const &(*pfn_t)(...); … … 70 70 71 71 template<typename F> 72 struct BOOST_PP_CAT(result_of_ is_callable_fun_, BOOST_PP_ITERATION());73 74 template<typename F> 75 struct BOOST_PP_CAT(result_of_ is_callable_fun_, BOOST_PP_ITERATION())<F *>76 : BOOST_PP_CAT(result_of_ is_callable_fun_2_, BOOST_PP_ITERATION())<F>77 {}; 78 79 template<typename F> 80 struct BOOST_PP_CAT(result_of_ is_callable_fun_, BOOST_PP_ITERATION())<F &>81 : BOOST_PP_CAT(result_of_ is_callable_fun_2_, BOOST_PP_ITERATION())<F>72 struct BOOST_PP_CAT(result_of_callable_fun_, BOOST_PP_ITERATION()); 73 74 template<typename F> 75 struct BOOST_PP_CAT(result_of_callable_fun_, BOOST_PP_ITERATION())<F *> 76 : BOOST_PP_CAT(result_of_callable_fun_2_, BOOST_PP_ITERATION())<F> 77 {}; 78 79 template<typename F> 80 struct BOOST_PP_CAT(result_of_callable_fun_, BOOST_PP_ITERATION())<F &> 81 : BOOST_PP_CAT(result_of_callable_fun_2_, BOOST_PP_ITERATION())<F> 82 82 {}; 83 83 … … 86 86 : mpl::eval_if< 87 87 is_class<typename remove_reference<F>::type>, 88 result_of_wrap_callable <result_of_callable_class,F>,89 mpl::identity<BOOST_PP_CAT(result_of_ is_callable_fun_, BOOST_PP_ITERATION())<typename remove_cv<F>::type> >88 result_of_wrap_callable_class<F>, 89 mpl::identity<BOOST_PP_CAT(result_of_callable_fun_, BOOST_PP_ITERATION())<typename remove_cv<F>::type> > 90 90 > 91 91 {}; … … 120 120 }; 121 121 122 #else // BOOST_ NO_SFINAE_EXPR122 #else // BOOST_RESULT_OF_NO_SFINAE_EXPR 123 123 124 124 template<typename F BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_ITERATION(),typename T)> … … 136 136 }; 137 137 138 #endif // BOOST_ NO_SFINAE_EXPR138 #endif // BOOST_RESULT_OF_NO_SFINAE_EXPR 139 139 140 140 } // namespace detail 
trunk/boost/utility/result_of.hpp
r80636 r80654 55 55 #endif 56 56 57 #if defined(BOOST_NO_SFINAE_EXPR)  (BOOST_WORKAROUND(__GNUC__, == 4) && __GNUC_MINOR__ < 5) 58 # define BOOST_RESULT_OF_NO_SFINAE_EXPR 59 #endif 60 57 61 namespace boost { 58 62 … … 67 71 template<typename F, typename FArgs, bool HasResultType> struct tr1_result_of_impl; 68 72 69 #ifdef BOOST_ NO_SFINAE_EXPR73 #ifdef BOOST_RESULT_OF_NO_SFINAE_EXPR 70 74 71 75 template<typename T> T result_of_decay(T); … … 74 78 { 75 79 result_of_private_type const &operator,(int) const; 76 };77 78 template<typename C>79 struct result_of_callable_class : C {80 result_of_callable_class();81 typedef result_of_private_type const &(*pfn_t)(...);82 operator pfn_t() const volatile;83 80 }; 84 81 … … 91 88 result_of_yes_type result_of_is_private_type(result_of_private_type const &); 92 89 93 template<template<typename> class Wrapper, typename C> 94 struct result_of_wrap_callable { 95 typedef Wrapper<C> type; 90 template<typename C> 91 struct result_of_callable_class : C { 92 result_of_callable_class(); 93 typedef result_of_private_type const &(*pfn_t)(...); 94 operator pfn_t() const volatile; 96 95 }; 97 96 98 template<t emplate<typename> class Wrapper, typename C>99 struct result_of_wrap_callable <Wrapper, C &>{100 typedef typename result_of_wrap_callable<Wrapper, C>::type &type;97 template<typename C> 98 struct result_of_wrap_callable_class { 99 typedef result_of_callable_class<C> type; 101 100 }; 102 101 103 template<t emplate<typename> class Wrapper, typename C>104 struct result_of_wrap_callable <Wrapper,C const> {105 typedef typename result_of_wrap_callable<Wrapper, C>::typeconst type;102 template<typename C> 103 struct result_of_wrap_callable_class<C const> { 104 typedef result_of_callable_class<C> const type; 106 105 }; 107 106 108 template<t emplate<typename> class Wrapper, typename C>109 struct result_of_wrap_callable <Wrapper,C volatile> {110 typedef typename result_of_wrap_callable<Wrapper, C>::typevolatile type;107 template<typename C> 108 struct result_of_wrap_callable_class<C volatile> { 109 typedef result_of_callable_class<C> volatile type; 111 110 }; 112 111 113 template<template<typename> class Wrapper, typename C> 114 struct result_of_wrap_callable<Wrapper, C const volatile> { 115 typedef typename result_of_wrap_callable<Wrapper, C>::type const volatile type; 112 template<typename C> 113 struct result_of_wrap_callable_class<C const volatile> { 114 typedef result_of_callable_class<C> const volatile type; 115 }; 116 117 template<typename C> 118 struct result_of_wrap_callable_class<C &> { 119 typedef typename result_of_wrap_callable_class<C>::type &type; 116 120 }; 117 121 118 122 template<typename F, bool TestCallability = true> struct cpp0x_result_of_impl; 119 123 120 #else // BOOST_ NO_SFINAE_EXPR124 #else // BOOST_RESULT_OF_NO_SFINAE_EXPR 121 125 122 126 template<typename T> … … 128 132 template<typename F, typename Enable = void> struct cpp0x_result_of_impl {}; 129 133 130 #endif // BOOST_ NO_SFINAE_EXPR134 #endif // BOOST_RESULT_OF_NO_SFINAE_EXPR 131 135 132 136 template<typename F>
Note: See TracChangeset
for help on using the changeset viewer.