[#bsl-operator_eq-0cd4] = xref:bsl.adoc[bsl]::operator== :relfileprefix: ../ :mrdocs: Return whether the operands have the same value. == Synopsis Declared in `<bslstl_optional.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class t_LHS_TYPE, class t_RHS_TYPE> constexpr bool operator==( std::optional<t_LHS_TYPE> const& lhs, xref:bsl/optional-072.adoc[bsl::optional<t_RHS_TYPE>] const& rhs); ---- == Description Return `true` if the specified `lhs` and `rhs` optional objects have the same value, and `false` otherwise. 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. Note that this function will fail to compile if `t_LHS_TYPE` and `t_RHS_TYPE` are not compatible. These functions can be called in constant expressions only if the `bsl::optional`'s value type is not allocator‐aware. == Return Value `true` if `lhs` and `rhs` have the same value, and `false` otherwise == Parameters [cols="1,4"] |=== | Name| Description | *lhs* | left‐hand operand | *rhs* | right‐hand operand |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#