From 2d69c7a5ca6ef92ff4db3f9c702cfeb07f3f480b Mon Sep 17 00:00:00 2001 From: LeonineKing1199 Date: Thu, 18 Nov 2021 10:19:20 -0800 Subject: [PATCH] Add missing const-qualification of `operator==` for internal `optional` implementation --- include/boost/unordered/detail/implementation.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/boost/unordered/detail/implementation.hpp b/include/boost/unordered/detail/implementation.hpp index 5daf53ee..1352d462 100644 --- a/include/boost/unordered/detail/implementation.hpp +++ b/include/boost/unordered/detail/implementation.hpp @@ -827,13 +827,13 @@ namespace boost { T* operator->() { return value_.value_ptr(); } T const* operator->() const { return value_.value_ptr(); } - bool operator==(optional const& x) + bool operator==(optional const& x) const { return has_value_ ? x.has_value_ && value_.value() == x.value_.value() : !x.has_value_; } - bool operator!=(optional const& x) { return !((*this) == x); } + bool operator!=(optional const& x) const { return !((*this) == x); } void swap(optional& x) {