bsl::operator==

Return whether the operands have the same value.

Synopsis

Declared in <bslstl_optional.h>

template<
    class t_LHS_TYPE,
    class t_RHS_TYPE>
constexpr
bool
operator==(
    bsl::optional<t_LHS_TYPE> const& lhs,
    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. This function can be called in constant expressions only if neither t_LHS_TYPE nor t_RHS_TYPE is allocator-aware.

Return Value

true if lhs and rhs have the same value, and false otherwise

Parameters

NameDescription
lhsleft-hand operand
rhsright-hand operand