@@ -42,10 +42,10 @@ struct limit_trackable_target
42
42
template <typename T_type>
43
43
void operator ()(T_type&& type) const
44
44
{
45
- using T_self = limit_trackable_target<T_action>;
46
-
47
45
// Only call action_() if T_Type derives from trackable.
48
- with_type<T_type, T_self>::execute_ (std::forward<T_type>(type), *this );
46
+ if constexpr (is_base_of_or_same_v<sigc::trackable, T_type>) {
47
+ action_ (type);
48
+ }
49
49
}
50
50
51
51
explicit limit_trackable_target (const T_action& action) : action_(action) {}
@@ -56,27 +56,6 @@ struct limit_trackable_target
56
56
limit_trackable_target& operator =(limit_trackable_target&& src) = delete ;
57
57
58
58
T_action action_;
59
-
60
- private:
61
- template <typename T_type, typename T_limit, bool I_derived = is_base_of_or_same_v<sigc::trackable, T_type>>
62
- struct with_type ;
63
-
64
- // Specialization for I_derived = false
65
- template <typename T_type, typename T_limit>
66
- struct with_type <T_type, T_limit, false >
67
- {
68
- static void execute_ (const T_type&, const T_limit&) {}
69
- };
70
-
71
- // Specialization for I_derived = true
72
- template <typename T_type, typename T_limit>
73
- struct with_type <T_type, T_limit, true >
74
- {
75
- static void execute_ (const T_type& type, const T_limit& action)
76
- {
77
- action.action_ (type);
78
- }
79
- };
80
59
};
81
60
82
61
} /* namespace internal */
0 commit comments