fsm
traits.h
Go to the documentation of this file.
1 
12 #pragma once
13 
14 #include "../access_context.h"
15 
16 namespace escad::detail
17 {
18 
19 template<class T, class E>
21 {
22  template<class U>
23  static auto test(int) -> decltype(std::declval<U>().handle(std::declval<E>()), std::true_type{});
24 
25  template<class>
26  static std::false_type test(...);
27 
28 public:
29  static constexpr auto value = std::is_same_v<std::true_type, decltype(test<T>(0))>;
30 };
31 
32 template<class T, class E, class C>
34 {
35  static C& get_context() noexcept;
36 
37  template<class U>
38  static auto test(int) -> decltype(std::declval<U>().handle(std::declval<E>(), get_context()), std::true_type{});
39 
40  template<class>
41  static std::false_type test(...);
42 
43 public:
44  static constexpr auto value = std::is_same_v<std::true_type, decltype(test<T>(0))>;
45 };
46 
47 } // namespace fsm::detail
Definition: traits.h:20
Definition: handle_result.h:14