Commit 41dc4ac4 authored by Dominik Charousset's avatar Dominik Charousset

Allow setting actor handles to nullptr

parent 988eba79
......@@ -110,6 +110,11 @@ public:
actor& operator=(const scoped_actor& x);
inline actor& operator=(std::nullptr_t) {
ptr_.reset();
return *this;
}
/// Queries whether this actor handle is valid.
inline explicit operator bool() const {
return static_cast<bool>(ptr_);
......
......@@ -20,6 +20,8 @@
#ifndef CAF_TYPED_ACTOR_HPP
#define CAF_TYPED_ACTOR_HPP
#include <cstddef>
#include "caf/intrusive_ptr.hpp"
#include "caf/make_actor.hpp"
......@@ -166,6 +168,11 @@ class typed_actor : detail::comparable<typed_actor<Sigs...>>,
return *this;
}
inline typed_actor& operator=(std::nullptr_t) {
ptr_.reset();
return *this;
}
explicit typed_actor(const unsafe_actor_handle_init_t&) CAF_DEPRECATED {
// nop
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment