File tree Expand file tree Collapse file tree 1 file changed +15
-7
lines changed Expand file tree Collapse file tree 1 file changed +15
-7
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 {
13
+ # if __cplusplus >= 201703L
16
14
17
- # if __cplusplus >= 201703L || defined(_MSC_VER)
15
+ namespace MQTT_NS {
18
16
19
17
template <typename Func, typename ... Params>
20
18
using is_invocable = typename std::is_invocable<Func, Params...>;
21
19
20
+ } // namespace MQTT_NS
21
+
22
22
#else // __cplusplus >= 201703L
23
23
24
- template <typename Func, typename ... Params>
25
- using is_invocable = typename boost::callable_traits::is_invocable<Func, Params...>;
24
+ #include < mqtt/move_only_function.hpp>
26
25
27
- #endif // __cplusplus >= 201703L
26
+ namespace MQTT_NS {
27
+
28
+ template <typename Func, typename ... Params>
29
+ struct is_invocable : std::is_constructible<
30
+ move_only_function<void (Params...)>,
31
+ std::reference_wrapper<typename std::remove_reference<Func>::type>
32
+ >
33
+ {};
28
34
29
35
} // namespace MQTT_NS
30
36
37
+ #endif // __cplusplus >= 201703L
38
+
31
39
#endif // MQTT_IS_INVOCABLE_HPP
You can’t perform that action at this time.
0 commit comments