Commit 50304f28 authored by Dominik Charousset's avatar Dominik Charousset

Remove implicit type cast in `typed_actor`

This patch removes the `static_cast` from operators -> and * in `typed_actor`.
Those casts are not safe, because the handle can point to an unrelated type
that only happens to support given interface. Fixes #136.
parent bd0d7b98
......@@ -102,9 +102,13 @@ class typed_actor
set(other);
}
pointer operator->() const { return static_cast<pointer>(m_ptr.get()); }
abstract_actor* operator->() const {
return m_ptr.get();
}
base& operator*() const { return static_cast<base&>(*m_ptr.get()); }
abstract_actor& operator*() const {
return *m_ptr.get();
}
/**
* @brief Queries the address of the stored actor.
......
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