@@ -1011,30 +1011,35 @@ struct get_state_mapping<sm<T>, TMappings, TUnexpected> {
10111011};
10121012template <class T , class TMappings , class TUnexpected >
10131013using get_state_mapping_t = typename get_state_mapping<T, TMappings, TUnexpected>::type;
1014- template <class >
1014+ template <class ... >
10151015transitions<aux::true_type> get_event_mapping_impl (...);
10161016template <class T , class TMappings >
10171017TMappings get_event_mapping_impl (event_mappings<T, TMappings> *);
1018- template <class T , class ... T1Mappings, class ... T2Mappings>
1019- unique_mappings_t <T1Mappings..., T2Mappings...> get_event_mapping_impl (event_mappings<T, aux::inherit<T1Mappings...>> *,
1020- event_mappings<_, aux::inherit<T2Mappings...>> *);
1018+ template <class T1 , class T2 , class ... T1Mappings, class ... T2Mappings>
1019+ unique_mappings_t <T1Mappings..., T2Mappings...> get_event_mapping_impl (event_mappings<T1, aux::inherit<T1Mappings...>> *,
1020+ event_mappings<T2, aux::inherit<T2Mappings...>> *);
1021+ template <class E , class _ , class TMappings >
1022+ using with_default_event_mapping_t = typename aux::conditional<
1023+ aux::is_same<transitions<aux::true_type>, decltype (get_event_mapping_impl<_>((TMappings *)0 ))>::value,
1024+ decltype (get_event_mapping_impl<E>((TMappings *)0 )),
1025+ typename aux::conditional<
1026+ aux::is_same<transitions<aux::true_type>, decltype (get_event_mapping_impl<E>((TMappings *)0 ))>::value,
1027+ decltype (get_event_mapping_impl<_>((TMappings *)0 )),
1028+ decltype (get_event_mapping_impl<E, _>((TMappings *)0 , (TMappings *)0 ))>::type>::type;
10211029template <class T , class TMappings >
1022- struct get_event_mapping_impl_helper
1023- : aux::conditional<aux::is_same<transitions<aux::true_type>, decltype (get_event_mapping_impl<_>((TMappings *)0 ))>::value,
1024- decltype (get_event_mapping_impl<T>((TMappings *)0)),
1025- decltype(get_event_mapping_impl<T>((TMappings *)0, (TMappings *)0))>::type {};
1030+ struct get_event_mapping_impl_helper : with_default_event_mapping_t <T, _, TMappings> {};
10261031template <class T , class TMappings >
10271032struct get_event_mapping_impl_helper <exception<T>, TMappings> : decltype (get_event_mapping_impl<exception<T>>((TMappings *)0 )) {
10281033};
1029- template <class T1 , class T2 , class TMappings >
1030- struct get_event_mapping_impl_helper <unexpected_event<T1, T2 >, TMappings>
1031- : decltype (get_event_mapping_impl <unexpected_event<T1, T2>>((TMappings *) 0 )) {};
1032- template <class T1 , class T2 , class TMappings >
1033- struct get_event_mapping_impl_helper <on_entry<T1, T2 >, TMappings>
1034- : decltype (get_event_mapping_impl <on_entry<T1, T2>>((TMappings *) 0 )) {};
1035- template <class T1 , class T2 , class TMappings >
1036- struct get_event_mapping_impl_helper <on_exit<T1, T2 >, TMappings>
1037- : decltype (get_event_mapping_impl <on_exit<T1, T2>>((TMappings *) 0 )) {};
1034+ template <class E , class _ , class TMappings >
1035+ struct get_event_mapping_impl_helper <unexpected_event<_, E >, TMappings>
1036+ : with_default_event_mapping_t <unexpected_event<_, E>, unexpected_event<_, _>, TMappings> {};
1037+ template <class E , class _ , class TMappings >
1038+ struct get_event_mapping_impl_helper <on_entry<_, E >, TMappings>
1039+ : with_default_event_mapping_t <on_entry<_, E>, on_entry<_, _>, TMappings> {};
1040+ template <class E , class _ , class TMappings >
1041+ struct get_event_mapping_impl_helper <on_exit<_, E >, TMappings>
1042+ : with_default_event_mapping_t <on_exit<_, E>, on_exit<_, _>, TMappings> {};
10381043template <class T , class TMappings >
10391044using get_event_mapping_t = get_event_mapping_impl_helper<T, TMappings>;
10401045}
@@ -1427,12 +1432,12 @@ struct sm_impl : aux::conditional_t<aux::is_empty<typename TSM::sm>::value, aux:
14271432 bool process_internal_event(const TEvent &event, TDeps &deps, TSubs &subs, state_t ¤t_state) {
14281433 policies::log_process_event<sm_t >(aux::type<logger_t >{}, deps, event);
14291434#if BOOST_SML_DISABLE_EXCEPTIONS
1430- return process_event_impl<get_event_mapping_t <get_mapped_t <TEvent>, mappings>>(event, deps, subs, states_t {}, current_state)
1435+ return process_event_impl<get_event_mapping_t <get_mapped_t <TEvent>, mappings>>(event, deps, subs, states_t {},
1436+ current_state);
14311437#else
14321438 return process_event_noexcept<get_event_mapping_t <get_mapped_t <TEvent>, mappings>>(event, deps, subs, current_state,
1433- has_exceptions{})
1439+ has_exceptions{});
14341440#endif
1435- || process_internal_generic_event (event, deps, subs, current_state);
14361441 }
14371442 template <class TMappings , class TEvent , class TDeps , class TSubs , class ... TStates>
14381443 bool process_event_impl (const TEvent &event, TDeps &deps, TSubs &subs, const aux::type_list<TStates...> &states,
0 commit comments