|
9 | 9 | */ |
10 | 10 | #pragma once |
11 | 11 |
|
12 | | -#include <boost/function_types/function_arity.hpp> |
13 | | -#include <boost/function_types/parameter_types.hpp> |
14 | | -#include <boost/function_types/result_type.hpp> |
15 | | -#include <boost/mpl/at.hpp> |
16 | 12 | #include <boost/preprocessor.hpp> |
17 | 13 |
|
| 14 | +#include "common/function_traits.hpp" |
18 | 15 | #include "function_wrapper.hpp" |
19 | 16 | #include "generator.hpp" |
20 | 17 |
|
21 | | -#define GEN_EXPORT_BINDING_IMPL_PARAM_DECL(z, i, signature) \ |
22 | | - typename boost::mpl::at_c< \ |
23 | | - typename boost::function_types::parameter_types<::cpp_bindgen::wrapped_t<signature>>::type, \ |
24 | | - i>::type param_##i |
| 18 | +#define GEN_EXPORT_BINDING_IMPL_PARAM_DECL(z, i, signature) \ |
| 19 | + typename std::tuple_element<i, \ |
| 20 | + ::cpp_bindgen::function_traits::parameter_types<::cpp_bindgen::wrapped_t<signature>>::type>::type param_##i |
25 | 21 |
|
26 | | -#define GEN_ADD_GENERATED_DEFINITION_IMPL(n, name, cppsignature, impl) \ |
27 | | - static_assert(::boost::function_types::function_arity<cppsignature>::value == n, "arity mismatch"); \ |
28 | | - extern "C" typename ::boost::function_types::result_type<::cpp_bindgen::wrapped_t<cppsignature>>::type name( \ |
29 | | - BOOST_PP_ENUM(n, GEN_EXPORT_BINDING_IMPL_PARAM_DECL, cppsignature)) { \ |
30 | | - return ::cpp_bindgen::wrap<cppsignature>(impl)(BOOST_PP_ENUM_PARAMS(n, param_)); \ |
| 22 | +#define GEN_ADD_GENERATED_DEFINITION_IMPL(n, name, cppsignature, impl) \ |
| 23 | + static_assert(::cpp_bindgen::function_traits::arity<cppsignature>::value == n, "arity mismatch"); \ |
| 24 | + extern "C" typename ::cpp_bindgen::function_traits::result_type<::cpp_bindgen::wrapped_t<cppsignature>>::type \ |
| 25 | + name(BOOST_PP_ENUM(n, GEN_EXPORT_BINDING_IMPL_PARAM_DECL, cppsignature)) { \ |
| 26 | + return ::cpp_bindgen::wrap<cppsignature>(impl)(BOOST_PP_ENUM_PARAMS(n, param_)); \ |
31 | 27 | } |
32 | 28 |
|
33 | 29 | /** |
|
0 commit comments