diff --git a/AK/Optional.h b/AK/Optional.h index ccc0986d20..ac7d04d6e5 100644 --- a/AK/Optional.h +++ b/AK/Optional.h @@ -97,6 +97,12 @@ public: return *this; } + template + bool operator==(const Optional& other) const + { + return has_value() == other.has_value() && (!has_value() || value() == other.value()); + } + ALWAYS_INLINE ~Optional() { clear();