Commit 9aa86106 authored by Dominik Charousset's avatar Dominik Charousset

Use `safe_equal` in == operator of `optional`

parent 39963a47
...@@ -27,6 +27,8 @@ ...@@ -27,6 +27,8 @@
#include "caf/unit.hpp" #include "caf/unit.hpp"
#include "caf/config.hpp" #include "caf/config.hpp"
#include "caf/detail/safe_equal.hpp"
namespace caf { namespace caf {
/** /**
...@@ -272,7 +274,7 @@ class optional<T&> { ...@@ -272,7 +274,7 @@ class optional<T&> {
template <class T, typename U> template <class T, typename U>
bool operator==(const optional<T>& lhs, const optional<U>& rhs) { bool operator==(const optional<T>& lhs, const optional<U>& rhs) {
if ((lhs) && (rhs)) { if ((lhs) && (rhs)) {
return *lhs == *rhs; return detail::safe_equal(*lhs, *rhs);
} }
return !lhs && !rhs; return !lhs && !rhs;
} }
......
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