@@ -23,6 +23,25 @@ struct rt_node {
23
23
rt_node const &) -> bool = default ;
24
24
};
25
25
26
+ namespace detail {
27
+ template <typename Cond, typename F> constexpr auto run_func () -> void {
28
+ if (Cond{}) {
29
+ F{}();
30
+ }
31
+ }
32
+
33
+ template <typename ct_node, typename Cond, stdx::ct_string Type,
34
+ stdx::ct_string Name>
35
+ constexpr auto log_func () -> void {
36
+ if (Cond{}) {
37
+ using log_spec_t = decltype (get_log_spec<ct_node>());
38
+ CIB_LOG (typename log_spec_t ::flavor, log_spec_t ::level, " flow.{}({})" ,
39
+ stdx::ct_string_to_type<Type, sc::string_constant>(),
40
+ stdx::ct_string_to_type<Name, sc::string_constant>());
41
+ }
42
+ }
43
+ } // namespace detail
44
+
26
45
template <stdx::ct_string Type, stdx::ct_string Name,
27
46
subgraph_identity Identity, typename Cond, typename F>
28
47
struct ct_node {
@@ -40,19 +59,8 @@ struct ct_node {
40
59
constexpr static auto condition = Cond{};
41
60
42
61
constexpr operator rt_node () const {
43
- return rt_node{
44
- [] {
45
- if (condition) {
46
- F{}();
47
- }
48
- },
49
- [] {
50
- if (condition) {
51
- using log_spec_t = decltype (get_log_spec<ct_node>());
52
- CIB_LOG (typename log_spec_t ::flavor, log_spec_t ::level,
53
- " flow.{}({})" , type_t {}, name_t {});
54
- }
55
- }};
62
+ return rt_node{detail::run_func<Cond, F>,
63
+ detail::log_func<ct_node, Cond, Type, Name>};
56
64
}
57
65
58
66
constexpr auto operator *() const {
0 commit comments