File tree 1 file changed +15
-6
lines changed
1 file changed +15
-6
lines changed Original file line number Diff line number Diff line change 8
8
#define MQTT_IS_INVOCABLE_HPP
9
9
10
10
#include < type_traits>
11
- #include < boost/callable_traits.hpp>
12
-
13
11
#include < mqtt/namespace.hpp>
14
12
15
- namespace MQTT_NS {
16
13
17
14
#if __cplusplus >= 201703L || defined(_MSC_VER)
18
15
16
+ namespace MQTT_NS {
17
+
19
18
template <typename Func, typename ... Params>
20
19
using is_invocable = typename std::is_invocable<Func, Params...>;
21
20
21
+ } // namespace MQTT_NS
22
+
22
23
#else // __cplusplus >= 201703L
23
24
24
- template <typename Func, typename ... Params>
25
- using is_invocable = typename boost::callable_traits::is_invocable<Func, Params...>;
25
+ #include < functional>
26
26
27
- #endif // __cplusplus >= 201703L
27
+ namespace MQTT_NS {
28
+
29
+ template <typename Func, typename ... Params>
30
+ struct is_invocable : std::is_constructible<
31
+ std::function<void (Params...)>,
32
+ std::reference_wrapper<typename std::remove_reference<Func>::type>
33
+ >
34
+ {};
28
35
29
36
} // namespace MQTT_NS
30
37
38
+ #endif // __cplusplus >= 201703L
39
+
31
40
#endif // MQTT_IS_INVOCABLE_HPP
You can’t perform that action at this time.
0 commit comments