File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -133,8 +133,12 @@ public:
133
133
void set (MutableValuePtr<T>&& value_ptr) { set (ImmutableValuePtr<T>(std::forward<MutableValuePtr<T>>(value_ptr))); }
134
134
void set (const T& value) { set (make_immutable_value<T>(value)); }
135
135
void set (T&& value) { set (make_immutable_value<T>(std::forward<T>(value))); }
136
- // Setting a port to nullptr is not permitted.
137
- void set (std::nullptr_t ) = delete;
136
+
137
+ // Setting a port to nullptr is not permitted. We use enable_if to only delete
138
+ // set() if it is actually called with nullptr. Without enable_if set(0) would
139
+ // be ambiguous as 0 can be implicitly casted to nullptr_t.
140
+ template <typename V, typename = std::enable_if_t <std::is_same_v<V, std::nullptr_t >>> void set (V) = delete;
141
+
138
142
void startup () final {}
139
143
void shutdown () final {}
140
144
You can’t perform that action at this time.
0 commit comments