Commit cb019a17 authored by Dominik Charousset's avatar Dominik Charousset

Disable operator== for unrelated intrusive_ptr

parent 41839213
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <type_traits> #include <type_traits>
#include "caf/detail/comparable.hpp" #include "caf/detail/comparable.hpp"
#include "caf/detail/type_traits.hpp"
namespace caf { namespace caf {
...@@ -214,13 +215,15 @@ bool operator!=(const T* x, const intrusive_ptr<T>& y) { ...@@ -214,13 +215,15 @@ bool operator!=(const T* x, const intrusive_ptr<T>& y) {
/// @relates intrusive_ptr /// @relates intrusive_ptr
template <class T, class U> template <class T, class U>
bool operator==(const intrusive_ptr<T>& x, const intrusive_ptr<U>& y) { detail::enable_if_t<detail::is_comparable<T*, U*>::value, bool>
operator==(const intrusive_ptr<T>& x, const intrusive_ptr<U>& y) {
return x.get() == y.get(); return x.get() == y.get();
} }
/// @relates intrusive_ptr /// @relates intrusive_ptr
template <class T, class U> template <class T, class U>
bool operator!=(const intrusive_ptr<T>& x, const intrusive_ptr<U>& y) { detail::enable_if_t<detail::is_comparable<T*, U*>::value, bool>
operator!=(const intrusive_ptr<T>& x, const intrusive_ptr<U>& y) {
return x.get() != y.get(); return x.get() != y.get();
} }
......
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