@@ -216,7 +216,7 @@ struct remove_reference<T &&> {
216
216
};
217
217
template <class T >
218
218
using remove_reference_t = typename remove_reference<T>::type;
219
- }
219
+ } // namespace aux
220
220
namespace aux {
221
221
using swallow = int [];
222
222
template <int ...>
@@ -480,7 +480,7 @@ auto get_type_name(const char *ptr, index_sequence<Ns...>) {
480
480
static const char str[] = {ptr[N + Ns]..., 0 };
481
481
return str;
482
482
}
483
- }
483
+ } // namespace detail
484
484
template <class T >
485
485
const char *get_type_name () {
486
486
#if defined(_MSC_VER) && !defined(__clang__)
@@ -525,7 +525,7 @@ struct string<T> {
525
525
}
526
526
static auto c_str_impl (...) { return get_type_name<T>(); }
527
527
};
528
- }
528
+ } // namespace aux
529
529
namespace back {
530
530
namespace policies {
531
531
struct defer_queue_policy__ {};
@@ -535,8 +535,8 @@ struct defer_queue : aux::pair<back::policies::defer_queue_policy__, defer_queue
535
535
using rebind = T<U>;
536
536
using flag = bool ;
537
537
};
538
- }
539
- }
538
+ } // namespace policies
539
+ } // namespace back
540
540
namespace back {
541
541
template <class ... Ts>
542
542
class queue_event {
@@ -627,7 +627,7 @@ struct deque_handler : queue_event_call<TEvents>... {
627
627
}
628
628
void *deque_{};
629
629
};
630
- }
630
+ } // namespace back
631
631
namespace back {
632
632
struct _ {};
633
633
struct initial {};
@@ -709,7 +709,7 @@ template <class... TEvents>
709
709
struct defer : deque_handler<TEvents...> {
710
710
using deque_handler<TEvents...>::deque_handler;
711
711
};
712
- }
712
+ } // namespace back
713
713
namespace back {
714
714
template <class >
715
715
class sm ;
@@ -832,7 +832,7 @@ template <class T, class... Ts>
832
832
struct convert_to_sm <T, aux::type_list<Ts...>> {
833
833
using type = aux::type_list<sm_impl<T>, sm_impl<typename T::template rebind<Ts>>...>;
834
834
};
835
- }
835
+ } // namespace back
836
836
namespace back {
837
837
template <class >
838
838
class sm ;
@@ -919,7 +919,7 @@ struct transitions_sub<sm<TSM>> {
919
919
return false ;
920
920
}
921
921
};
922
- }
922
+ } // namespace back
923
923
namespace back {
924
924
template <class >
925
925
class sm ;
@@ -1011,33 +1011,38 @@ struct get_state_mapping<sm<T>, TMappings, TUnexpected> {
1011
1011
};
1012
1012
template <class T , class TMappings , class TUnexpected >
1013
1013
using get_state_mapping_t = typename get_state_mapping<T, TMappings, TUnexpected>::type;
1014
- template <class >
1014
+ template <class ... >
1015
1015
transitions<aux::true_type> get_event_mapping_impl (...);
1016
1016
template <class T , class TMappings >
1017
1017
TMappings 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;
1021
1029
template <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> {};
1026
1031
template <class T , class TMappings >
1027
1032
struct get_event_mapping_impl_helper <exception<T>, TMappings> : decltype (get_event_mapping_impl<exception<T>>((TMappings *)0 )) {
1028
1033
};
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> {};
1038
1043
template <class T , class TMappings >
1039
1044
using get_event_mapping_t = get_event_mapping_impl_helper<T, TMappings>;
1040
- }
1045
+ } // namespace back
1041
1046
namespace back {
1042
1047
namespace policies {
1043
1048
struct dispatch_policy__ {};
@@ -1112,8 +1117,8 @@ struct fold_expr {
1112
1117
}
1113
1118
};
1114
1119
#endif
1115
- }
1116
- }
1120
+ } // namespace policies
1121
+ } // namespace back
1117
1122
namespace back {
1118
1123
template <class >
1119
1124
class sm ;
@@ -1180,8 +1185,8 @@ void log_guard(const aux::type<TLogger> &, TDeps &deps, const aux::zero_wrapper<
1180
1185
bool result) {
1181
1186
return static_cast <aux::pool_type<TLogger &> &>(deps).value .template log_guard <SM>(guard.get (), event, result);
1182
1187
}
1183
- }
1184
- }
1188
+ } // namespace policies
1189
+ } // namespace back
1185
1190
namespace back {
1186
1191
namespace policies {
1187
1192
struct process_queue_policy__ {};
@@ -1190,14 +1195,14 @@ struct process_queue : aux::pair<back::policies::process_queue_policy__, process
1190
1195
template <class U >
1191
1196
using rebind = T<U>;
1192
1197
};
1193
- }
1194
- }
1198
+ } // namespace policies
1199
+ } // namespace back
1195
1200
namespace back {
1196
1201
namespace policies {
1197
1202
struct testing_policy__ {};
1198
1203
struct testing : aux::pair<testing_policy__, testing> {};
1199
- }
1200
- }
1204
+ } // namespace policies
1205
+ } // namespace back
1201
1206
namespace back {
1202
1207
namespace policies {
1203
1208
struct thread_safety_policy__ {
@@ -1217,8 +1222,8 @@ struct thread_safe : aux::pair<thread_safety_policy__, thread_safe<TLock>> {
1217
1222
}
1218
1223
TLock lock;
1219
1224
};
1220
- }
1221
- }
1225
+ } // namespace policies
1226
+ } // namespace back
1222
1227
namespace back {
1223
1228
struct no_policy : policies::thread_safety_policy__ {
1224
1229
using type = no_policy;
@@ -1257,7 +1262,7 @@ struct sm_policy {
1257
1262
template <class T >
1258
1263
using rebind = typename rebind_impl<T, TPolicies...>::type;
1259
1264
};
1260
- }
1265
+ } // namespace back
1261
1266
namespace concepts {
1262
1267
struct callable_fallback {
1263
1268
void operator ()();
@@ -1273,15 +1278,15 @@ template <class T, class R, class TBase, class... TArgs>
1273
1278
struct callable <T, R (TBase::*)(TArgs...)> : aux::true_type {};
1274
1279
template <class T , class R , class TBase , class ... TArgs>
1275
1280
struct callable <T, R (TBase::*)(TArgs...) const > : aux::true_type {};
1276
- }
1281
+ } // namespace concepts
1277
1282
namespace concepts {
1278
1283
template <class T >
1279
1284
decltype (aux::declval<T>().operator ()()) composable_impl(int );
1280
1285
template <class >
1281
1286
void composable_impl (...);
1282
1287
template <class T >
1283
1288
struct composable : aux::is<aux::pool, decltype (composable_impl<T>(0 ))> {};
1284
- }
1289
+ } // namespace concepts
1285
1290
#if !defined(BOOST_SML_DISABLE_EXCEPTIONS)
1286
1291
#if !(defined(__cpp_exceptions) || defined(__EXCEPTIONS) || defined(_CPPUNWIND))
1287
1292
#define BOOST_SML_DISABLE_EXCEPTIONS true
@@ -1427,12 +1432,12 @@ struct sm_impl : aux::conditional_t<aux::is_empty<typename TSM::sm>::value, aux:
1427
1432
bool process_internal_event(const TEvent &event, TDeps &deps, TSubs &subs, state_t ¤t_state) {
1428
1433
policies::log_process_event<sm_t >(aux::type<logger_t >{}, deps, event);
1429
1434
#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);
1431
1437
#else
1432
1438
return process_event_noexcept<get_event_mapping_t <get_mapped_t <TEvent>, mappings>>(event, deps, subs, current_state,
1433
- has_exceptions{})
1439
+ has_exceptions{});
1434
1440
#endif
1435
- || process_internal_generic_event (event, deps, subs, current_state);
1436
1441
}
1437
1442
template <class TMappings , class TEvent , class TDeps , class TSubs , class ... TStates>
1438
1443
bool process_event_impl (const TEvent &event, TDeps &deps, TSubs &subs, const aux::type_list<TStates...> &states,
@@ -1738,7 +1743,7 @@ class sm {
1738
1743
deps_t deps_;
1739
1744
sub_sms_t sub_sms_;
1740
1745
};
1741
- }
1746
+ } // namespace back
1742
1747
namespace front {
1743
1748
struct operator_base {};
1744
1749
struct action_base {};
@@ -1970,7 +1975,7 @@ class not_ : operator_base {
1970
1975
private:
1971
1976
T g;
1972
1977
};
1973
- }
1978
+ } // namespace front
1974
1979
template <class T , __BOOST_SML_REQUIRES(concepts::callable<bool , T>::value)>
1975
1980
auto operator!(const T &t) {
1976
1981
return front::not_<aux::zero_wrapper<T>>(aux::zero_wrapper<T>{t});
@@ -1999,8 +2004,8 @@ struct defer : action_base {
1999
2004
}
2000
2005
}
2001
2006
};
2002
- }
2003
- }
2007
+ } // namespace actions
2008
+ } // namespace front
2004
2009
using testing = back::policies::testing;
2005
2010
template <class T >
2006
2011
using logger = back::policies::logger<T>;
@@ -2026,7 +2031,7 @@ auto transitional_impl(T &&t) -> aux::always<typename T::dst_state, typename T::
2026
2031
decltype(T::initial), decltype(T::history)>;
2027
2032
template <class T >
2028
2033
struct transitional : decltype (transitional_impl(aux::declval<T>())) {};
2029
- }
2034
+ } // namespace concepts
2030
2035
namespace front {
2031
2036
namespace actions {
2032
2037
struct process {
@@ -2047,8 +2052,8 @@ struct process {
2047
2052
return process_impl<TEvent>{event};
2048
2053
}
2049
2054
};
2050
- }
2051
- }
2055
+ } // namespace actions
2056
+ } // namespace front
2052
2057
namespace front {
2053
2058
template <class , class >
2054
2059
struct transition_eg ;
@@ -2066,7 +2071,7 @@ struct event {
2066
2071
}
2067
2072
auto operator ()() const { return TEvent{}; }
2068
2073
};
2069
- }
2074
+ } // namespace front
2070
2075
namespace front {
2071
2076
struct initial_state {};
2072
2077
struct history_state {};
@@ -2159,7 +2164,7 @@ struct state_sm<T, aux::enable_if_t<concepts::composable<T>::value>> {
2159
2164
using type = state<back::sm<back::sm_policy<T>>>;
2160
2165
};
2161
2166
#endif
2162
- }
2167
+ } // namespace front
2163
2168
namespace front {
2164
2169
struct internal {};
2165
2170
template <class , class >
@@ -2593,7 +2598,7 @@ struct transition<state<internal>, state<S2>, front::event<E>, always, none> {
2593
2598
}
2594
2599
__BOOST_SML_ZERO_SIZE_ARRAY (aux::byte);
2595
2600
};
2596
- }
2601
+ } // namespace front
2597
2602
using _ = back::_;
2598
2603
#if !(defined(_MSC_VER) && !defined(__clang__))
2599
2604
template <class TEvent >
@@ -2641,7 +2646,7 @@ constexpr auto operator""_e() {
2641
2646
return event<aux::string<T, Chrs...>>;
2642
2647
}
2643
2648
#endif
2644
- }
2649
+ } // namespace literals
2645
2650
__BOOST_SML_UNUSED static front::state<back::terminate_state> X;
2646
2651
__BOOST_SML_UNUSED static front::history_state H;
2647
2652
__BOOST_SML_UNUSED static front::actions::defer defer;
0 commit comments