Commit fd2fd0b1 authored by Dominik Charousset's avatar Dominik Charousset

Fix build on MSVC

parent 3d8fd257
...@@ -162,18 +162,34 @@ class caf_handle : caf::detail::comparable<caf_handle>, ...@@ -162,18 +162,34 @@ class caf_handle : caf::detail::comparable<caf_handle>,
public: public:
using pointer = caf::abstract_actor*; using pointer = caf::abstract_actor*;
constexpr caf_handle() : ptr_(nullptr) { constexpr caf_handle(pointer ptr = nullptr) : ptr_(ptr) {
// nop // nop
} }
template <class T> caf_handle(const caf::strong_actor_ptr& x) {
caf_handle(const T& x) { set(x);
*this = x; }
caf_handle(const caf::actor& x) {
set(x);
}
caf_handle(const caf::actor_addr& x) {
set(x);
}
caf_handle(const caf::scoped_actor& x) {
set(x);
}
template <class... Ts>
caf_handle(const caf::typed_actor<Ts...>& x) {
set(x);
} }
caf_handle(const caf_handle&) = default; caf_handle(const caf_handle&) = default;
inline caf_handle& operator=(caf::abstract_actor* x) { caf_handle& operator=(pointer x) {
ptr_ = x; ptr_ = x;
return *this; return *this;
} }
...@@ -181,7 +197,7 @@ public: ...@@ -181,7 +197,7 @@ public:
template <class T, template <class T,
class E = caf::detail::enable_if_t<!std::is_pointer<T>::value>> class E = caf::detail::enable_if_t<!std::is_pointer<T>::value>>
caf_handle& operator=(const T& x) { caf_handle& operator=(const T& x) {
ptr_ = caf::actor_cast<pointer>(x); set(x);
return *this; return *this;
} }
...@@ -205,6 +221,11 @@ public: ...@@ -205,6 +221,11 @@ public:
} }
private: private:
template <class T>
void set(const T& x) {
ptr_ = caf::actor_cast<pointer>(x);
}
caf::abstract_actor* ptr_; caf::abstract_actor* ptr_;
}; };
......
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