diff --git a/include/reactor-cpp/port.hh b/include/reactor-cpp/port.hh index 6fe01494..960c6517 100644 --- a/include/reactor-cpp/port.hh +++ b/include/reactor-cpp/port.hh @@ -133,8 +133,12 @@ public: void set(MutableValuePtr&& value_ptr) { set(ImmutableValuePtr(std::forward>(value_ptr))); } void set(const T& value) { set(make_immutable_value(value)); } void set(T&& value) { set(make_immutable_value(std::forward(value))); } - // Setting a port to nullptr is not permitted. - void set(std::nullptr_t) = delete; + + // Setting a port to nullptr is not permitted. We use enable_if to only delete + // set() if it is actually called with nullptr. Without enable_if set(0) would + // be ambiguous as 0 can be implicitly casted to nullptr_t. + template >> void set(V) = delete; + void startup() final {} void shutdown() final {}