Add missing const-qualification of operator== for internal optional implementation

This commit is contained in:
LeonineKing1199
2021-11-18 10:19:20 -08:00
parent 1e553df5b6
commit 2d69c7a5ca

View File

@ -827,13 +827,13 @@ namespace boost {
T* operator->() { return value_.value_ptr(); }
T const* operator->() const { return value_.value_ptr(); }
bool operator==(optional<T> const& x)
bool operator==(optional<T> const& x) const
{
return has_value_ ? x.has_value_ && value_.value() == x.value_.value()
: !x.has_value_;
}
bool operator!=(optional<T> const& x) { return !((*this) == x); }
bool operator!=(optional<T> const& x) const { return !((*this) == x); }
void swap(optional<T>& x)
{