@@ -23,6 +23,25 @@ struct rt_node {
2323 rt_node const &) -> bool = default ;
2424};
2525
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+
2645template <stdx::ct_string Type, stdx::ct_string Name,
2746 subgraph_identity Identity, typename Cond, typename F>
2847struct ct_node {
@@ -40,19 +59,8 @@ struct ct_node {
4059 constexpr static auto condition = Cond{};
4160
4261 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>};
5664 }
5765
5866 constexpr auto operator *() const {
0 commit comments