@@ -20,15 +20,16 @@ namespace detail {
20
20
* and handling incoming messages.
21
21
*/
22
22
template <stdx::ct_string Name, typename Msg, match::matcher M,
23
- stdx::callable F, typename ... ExtraArgs >
23
+ stdx::callable F>
24
24
struct callback {
25
25
[[nodiscard]] auto is_match (auto const &data) const -> bool {
26
26
auto view = typename Msg::view_t {data};
27
27
return matcher (view);
28
28
}
29
29
30
+ template <typename ... Args>
30
31
[[nodiscard]] auto handle (auto const &data,
31
- ExtraArgs const &...args) const -> bool {
32
+ Args const &...args) const -> bool {
32
33
auto view = typename Msg::view_t {data};
33
34
if (matcher (view)) {
34
35
CIB_INFO (" Incoming message matched [{}], because [{}], executing "
@@ -54,22 +55,21 @@ struct callback {
54
55
using callable_t = F;
55
56
56
57
template <match::matcher NewM>
57
- using rebind_matcher = callback<Name, Msg, NewM, F, ExtraArgs... >;
58
+ using rebind_matcher = callback<Name, Msg, NewM, F>;
58
59
59
60
constexpr static auto name = Name;
60
61
[[no_unique_address]] matcher_t matcher;
61
62
[[no_unique_address]] callable_t callable;
62
63
};
63
64
64
- template <stdx::ct_string Name, typename Msg, typename ... ExtraArgs>
65
- struct callback_construct_t {
65
+ template <stdx::ct_string Name, typename Msg> struct callback_construct_t {
66
66
template <match::matcher M, stdx::callable F>
67
67
[[nodiscard]] constexpr auto operator ()(M, F &&f) const {
68
68
using ::operator and ;
69
69
using matcher_t =
70
70
decltype (match::sum_of_products (M{} and typename Msg::matcher_t {}));
71
- return callback<Name, Msg, matcher_t , std::remove_cvref_t <F>,
72
- ExtraArgs...>{ matcher_t {}, std::forward<F>(f)};
71
+ return callback<Name, Msg, matcher_t , std::remove_cvref_t <F>>{
72
+ matcher_t {}, std::forward<F>(f)};
73
73
}
74
74
75
75
template <msg::matcher_maker M, stdx::callable F>
@@ -86,7 +86,6 @@ struct callback_construct_t {
86
86
};
87
87
} // namespace detail
88
88
89
- template <stdx::ct_string Name, typename Msg, typename ... ExtraArgs>
90
- constexpr inline auto callback =
91
- detail::callback_construct_t <Name, Msg, ExtraArgs...>{};
89
+ template <stdx::ct_string Name, typename Msg>
90
+ constexpr inline auto callback = detail::callback_construct_t <Name, Msg>{};
92
91
} // namespace msg
0 commit comments