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,
    t_RHS_TYPE const& rhs);

Description

Return true if the specified lhs and rhs objects have the same value, and false otherwise. An optional object and a value of some type have the same value if the optional object is engaged and its underlying value compares equal to the other value. These functions can be called in constant expressions only if the optional's value type is not allocator-aware.

Return Value

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

Parameters

NameDescription
lhsleft-hand operand
rhsright-hand operand