[#bsl-operator_eq-0cd4]
= xref:bsl.adoc[bsl]::operator&equals;&equals;
:relfileprefix: ../
:mrdocs:

Return `true` if the specified `lhs` and `rhs` optional objects have the same value, and `false` otherwise&period; Two optional objects have the same value if both are disengaged, or if both are engaged and the values of their underlying objects compare equal&period; Note that this function will fail to compile if `t&lowbar;LHS&lowbar;TYPE` and `t&lowbar;RHS&lowbar;TYPE` are not compatible&period; These functions can be called in constant expressions only if the `bsl&colon;&colon;optional`&apos;s value type is not allocator&hyphen;aware&period;

== Synopsis

Declared in `&lt;bslstl&lowbar;optional&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class t&lowbar;LHS&lowbar;TYPE,
    class t&lowbar;RHS&lowbar;TYPE&gt;
constexpr
bool
operator&equals;&equals;(
    std::optional&lt;t&lowbar;LHS&lowbar;TYPE&gt; const& lhs,
    xref:bsl/optional-072.adoc[bsl::optional&lt;t&lowbar;RHS&lowbar;TYPE&gt;] const& rhs);
----


[.small]#Created with https://www.mrdocs.com[MrDocs]#
