|
32 | 32 | #include <boost/type_traits/is_base_of.hpp> |
33 | 33 | #include <boost/type_traits/is_pointer.hpp> |
34 | 34 | #include <boost/type_traits/is_member_function_pointer.hpp> |
| 35 | +#include <boost/type_traits/is_member_object_pointer.hpp> |
35 | 36 | #include <boost/type_traits/remove_reference.hpp> |
36 | 37 | #ifndef BOOST_NO_CXX11_HDR_FUNCTIONAL |
37 | 38 | #include <functional> |
@@ -85,31 +86,37 @@ namespace boost |
85 | 86 |
|
86 | 87 | // bullets 3 and 4 |
87 | 88 |
|
88 | | - template <class Fp, class A0> |
| 89 | + // enable_if avoids |
| 90 | + // |
| 91 | + // ./boost/thread/detail/invoke.hpp:101:43: internal compiler error: in gimplify_expr, at gimplify.c:12039 |
| 92 | + // https://sourceforge.net/p/mingw-w64/bugs/694/ |
| 93 | + // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83756 |
| 94 | + |
| 95 | + template <class Fp, class A0, class En = typename boost::enable_if<boost::is_member_object_pointer<Fp> >::type> |
89 | 96 | inline auto |
90 | 97 | invoke(BOOST_THREAD_RV_REF(Fp) f, BOOST_THREAD_RV_REF(A0) a0) |
91 | 98 | -> decltype(boost::forward<A0>(a0).*f) |
92 | 99 | { |
93 | 100 | return boost::forward<A0>(a0).*f; |
94 | 101 | } |
95 | 102 |
|
96 | | - template <class Fp, class A0> |
| 103 | + template <class Fp, class A0, class En = typename boost::enable_if<boost::is_member_object_pointer<Fp> >::type> |
97 | 104 | inline auto |
98 | 105 | invoke(BOOST_THREAD_RV_REF(Fp) f, BOOST_THREAD_RV_REF(A0) a0) |
99 | 106 | -> decltype((*boost::forward<A0>(a0)).*f) |
100 | 107 | { |
101 | 108 | return (*boost::forward<A0>(a0)).*f; |
102 | 109 | } |
103 | 110 |
|
104 | | - template <class R, class Fp, class A0> |
| 111 | + template <class R, class Fp, class A0, class En = typename boost::enable_if<boost::is_member_object_pointer<Fp> >::type> |
105 | 112 | inline auto |
106 | 113 | invoke(BOOST_THREAD_RV_REF(Fp) f, BOOST_THREAD_RV_REF(A0) a0) |
107 | 114 | -> decltype(boost::forward<A0>(a0).*f) |
108 | 115 | { |
109 | 116 | return boost::forward<A0>(a0).*f; |
110 | 117 | } |
111 | 118 |
|
112 | | - template <class R, class Fp, class A0> |
| 119 | + template <class R, class Fp, class A0, class En = typename boost::enable_if<boost::is_member_object_pointer<Fp> >::type> |
113 | 120 | inline auto |
114 | 121 | invoke(BOOST_THREAD_RV_REF(Fp) f, BOOST_THREAD_RV_REF(A0) a0) |
115 | 122 | -> decltype((*boost::forward<A0>(a0)).*f) |
|
0 commit comments