bsl::operator==

Equality operators

Synopses

Declared in <bslstl_deque.h>

Return true if the specified lhs and rhs iterators refer to the same list element or both are the end() iterator of the same list.

bool
operator==(
    List_Iterator<T1> lhs,
    List_Iterator<T2> rhs);
» more...

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

template<
    class KEY,
    class HASH,
    class EQUAL,
    class ALLOCATOR>
bool
operator==(
    unordered_set<KEY, HASH, EQUAL, ALLOCATOR> const& lhs,
    unordered_set<KEY, HASH, EQUAL, ALLOCATOR> const& rhs);
» more...

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

bool
operator==(
    unordered_map<KEY2, VALUE2, HASH2, EQUAL2, ALLOCATOR2> const& lhs,
    unordered_map<KEY2, VALUE2, HASH2, EQUAL2, ALLOCATOR2> const& rhs);
» more...

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

template<
    class KEY,
    class VALUE,
    class HASH,
    class EQUAL,
    class ALLOCATOR>
bool
operator==(
    unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR> const& lhs,
    unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR> const& rhs);
» more...

Return true if lhs and rhs have the same value.

bool
operator==(
    unordered_multimap<KEY2, VALUE2, HASH2, EQUAL2, ALLOCATOR2> const& lhs,
    unordered_multimap<KEY2, VALUE2, HASH2, EQUAL2, ALLOCATOR2> const& rhs);
» more...

Return true if lhs and rhs have the same value.

template<
    class KEY,
    class VALUE,
    class HASH,
    class EQUAL,
    class ALLOCATOR>
bool
operator==(
    unordered_multimap<KEY, VALUE, HASH, EQUAL, ALLOCATOR> const& lhs,
    unordered_multimap<KEY, VALUE, HASH, EQUAL, ALLOCATOR> const& rhs);
» more...

Return true if lhs and rhs have the same value.

template<
    class VALUE_TYPE,
    class ALLOCATOR>
bool
operator==(
    deque<VALUE_TYPE, ALLOCATOR> const& lhs,
    deque<VALUE_TYPE, ALLOCATOR> const& rhs);
» more...

Return whether the specified stacks have the same value; see the non-member operator== in the bsl namespace.

bool
operator==(
    stack<VAL, CONT> const& lhs,
    stack<VAL, CONT> const& rhs);
» more...

Return whether the operands have the same value.

template<
    class VALUE,
    class CONTAINER>
bool
operator==(
    stack<VALUE, CONTAINER> const& lhs,
    stack<VALUE, CONTAINER> const& rhs);
» more...

Return true if lhs and rhs are equal.

template<
    class t_HEAD,
    class... t_TAIL>
bool
operator==(
    variant<t_HEAD, t_TAIL...> const& lhs,
    variant<t_HEAD, t_TAIL...> const& rhs);
» more...

Return whether the specified queues have the same value; see the non-member operator== in the bsl namespace.

bool
operator==(
    queue<VALUE2, CONTAINER2> const& lhs,
    queue<VALUE2, CONTAINER2> const& rhs);
» more...

Return true if lhs and rhs have the same value.

template<
    class VALUE,
    class CONTAINER>
bool
operator==(
    queue<VALUE, CONTAINER> const& lhs,
    queue<VALUE, CONTAINER> const& rhs);
» more...

Return true if the specified lhs and rhs objects have the same value, and false otherwise.

bool
operator==(
    unordered_set<KEY2, HASH2, EQUAL2, ALLOCATOR2> const& lhs,
    unordered_set<KEY2, HASH2, EQUAL2, ALLOCATOR2> const& rhs);
» more...

Return true if the specified lhs and rhs iterators refer to the same list element or both are the end() iterator of the same list.

template<
    class T1,
    class T2>
bool
operator==(
    List_Iterator<T1> lhs,
    List_Iterator<T2> rhs);
» more...

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

template<
    class VALUE,
    class ALLOCATOR>
bool
operator==(
    list<VALUE, ALLOCATOR> const& lhs,
    list<VALUE, ALLOCATOR> const& rhs);
» more...

Return true if the specified iterators refer to the same node.

template<
    class _Val,
    class _Traits,
    class _Traits1,
    class _Key,
    class _HF,
    class _ExK,
    class _EqK,
    class _All>
bool
operator==(
    _Ht_iterator<_Val, _Traits, _Key, _HF, _ExK, _EqK, _All> const& __x,
    _Ht_iterator<_Val, _Traits1, _Key, _HF, _ExK, _EqK, _All> const& __y);
» more...

Return true if the specified hash tables contain the same elements.

template<
    class _Val,
    class _Key,
    class _HF,
    class _ExK,
    class _EqK,
    class _All>
bool
operator==(
    hashtable<_Val, _Key, _HF, _ExK, _EqK, _All> const& __hm1,
    hashtable<_Val, _Key, _HF, _ExK, _EqK, _All> const& __hm2);
» more...

Return true if the specified hash sets contain the same elements.

template<
    class _Value,
    class _HashFcn,
    class _EqualKey,
    class _Alloc>
bool
operator==(
    hash_set<_Value, _HashFcn, _EqualKey, _Alloc> const& __hm1,
    hash_set<_Value, _HashFcn, _EqualKey, _Alloc> const& __hm2);
» more...

Return true if the specified hash multisets contain the same elements.

template<
    class _Value,
    class _HashFcn,
    class _EqualKey,
    class _Alloc>
bool
operator==(
    hash_multiset<_Value, _HashFcn, _EqualKey, _Alloc> const& __hm1,
    hash_multiset<_Value, _HashFcn, _EqualKey, _Alloc> const& __hm2);
» more...

Return true if the specified lists have the same elements in order.

template<
    class _Tp,
    class _Alloc>
bool
operator==(
    slist<_Tp, _Alloc> const& _SL1,
    slist<_Tp, _Alloc> const& _SL2);
» more...

Return true if the specified hash maps contain the same elements.

template<
    class _Key,
    class _Tp,
    class _HashFcn,
    class _EqlKey,
    class _Alloc>
bool
operator==(
    hash_map<_Key, _Tp, _HashFcn, _EqlKey, _Alloc> const& __hm1,
    hash_map<_Key, _Tp, _HashFcn, _EqlKey, _Alloc> const& __hm2);
» more...

Return true if the specified hash multimaps contain the same elements.

template<
    class _Key,
    class _Tp,
    class _HashFcn,
    class _EqlKey,
    class _Alloc>
bool
operator==(
    hash_multimap<_Key, _Tp, _HashFcn, _EqlKey, _Alloc> const& __hm1,
    hash_multimap<_Key, _Tp, _HashFcn, _EqlKey, _Alloc> const& __hm2);
» more...

Return whether lhs and rhs refer to the same stop state.

[[nodiscard]]
bool
operator==(
    stop_source const& lhs,
    stop_source const& rhs) noexcept;
» more...

Return whether lhs and rhs refer to the same stop state.

[[nodiscard]]
bool
operator==(
    stop_token const& lhs,
    stop_token const& rhs) noexcept;
» more...

Return true if lhs and rhs have the same value.

template<
    class KEY,
    class COMPARATOR,
    class ALLOCATOR>
bool
operator==(
    multiset<KEY, COMPARATOR, ALLOCATOR> const& lhs,
    multiset<KEY, COMPARATOR, ALLOCATOR> const& rhs);
» more...

Return true if the specified lhs and rhs iterators refer to the same element in the same underlying sequence or both refer to the past-the-end element.

bool
operator==(
    vector_UintPtrConversionIterator const& lhs,
    vector_UintPtrConversionIterator const& rhs);
» more...

Return whether the operands have the same value.

template<
    class VALUE_TYPE,
    class ALLOCATOR>
bool
operator==(
    vector<VALUE_TYPE, ALLOCATOR> const& lhs,
    vector<VALUE_TYPE, ALLOCATOR> const& rhs);
» more...

Return true if the specified lhs and rhs vectors have the same value, and false otherwise.

bool
operator==(
    vector const& lhs,
    vector const& rhs);
» more...

Same as the two-argument operator== for basic_string.

template<
    class CHAR_TYPE,
    class CHAR_TRAITS,
    class ALLOC>
bool
operator==(
    basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOC> const& lhs,
    basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOC> const& rhs) noexcept;
» more...

Same as the two-argument operator== for mixed bsl/std strings.

template<
    class CHAR_TYPE,
    class CHAR_TRAITS,
    class ALLOC1,
    class ALLOC2>
bool
operator==(
    bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOC1> const& lhs,
    std::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOC2> const& rhs) noexcept;
» more...

Return whether two strings have the same value.

template<
    class CHAR_TYPE,
    class CHAR_TRAITS,
    class ALLOC>
bool
operator==(
    basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOC> const& lhs,
    CHAR_TYPE const* rhs);
» more...

Return whether lhs and rhs refer to the same object.

template<
    class LHS_TYPE,
    class RHS_TYPE>
bool
operator==(
    shared_ptr<LHS_TYPE> const& lhs,
    shared_ptr<RHS_TYPE> const& rhs) noexcept;
» more...

Return true if the specified lhs shared pointer does not refer to an object, and false otherwise.

template<class LHS_TYPE>
bool
operator==(
    shared_ptr<LHS_TYPE> const& lhs,
    nullptr_t nullPointerLiteral) noexcept;
» more...

Return true if lhs and rhs have the same value.

template<
    class KEY,
    class VALUE,
    class COMPARATOR,
    class ALLOCATOR>
bool
operator==(
    map<KEY, VALUE, COMPARATOR, ALLOCATOR> const& lhs,
    map<KEY, VALUE, COMPARATOR, ALLOCATOR> const& rhs);
» more...

Return true if lhs and rhs have the same value.

template<
    class KEY,
    class VALUE,
    class COMPARATOR,
    class ALLOCATOR>
bool
operator==(
    multimap<KEY, VALUE, COMPARATOR, ALLOCATOR> const& lhs,
    multimap<KEY, VALUE, COMPARATOR, ALLOCATOR> const& rhs);
» more...

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

template<
    class KEY,
    class COMPARATOR,
    class ALLOCATOR>
bool
operator==(
    set<KEY, COMPARATOR, ALLOCATOR> const& lhs,
    set<KEY, COMPARATOR, ALLOCATOR> const& rhs);
» more...

Return true if the specified lhs and rhs pairs have the same value.

template<
    class T1,
    class T2>
constexpr
bool
operator==(
    pair<T1, T2> const& lhs,
    pair<T1, T2> const& rhs);
» more...

Return true if the specified function is empty.

template<class PROTOTYPE>
bool
operator==(
    function<PROTOTYPE> const& f,
    nullptr_t unused) noexcept;
» more...

Return true if the specified function is empty.

template<class PROTOTYPE>
bool
operator==(
    nullptr_t unused,
    function<PROTOTYPE> const& f) noexcept;
» more...

Return whether the operands have the same value.

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);
» more...

Return whether the operands have the same value.

template<class t_TYPE>
constexpr
bool
operator==(
    bsl::optional<t_TYPE> const& value,
    bsl::nullopt_t const& nullopt) noexcept;
» more...

Return whether the operands have the same value.

template<
    class t_LHS_TYPE,
    class t_RHS_TYPE>
constexpr
bool
operator==(
    bsl::optional<t_LHS_TYPE> const& lhs,
    t_RHS_TYPE const& rhs);
» more...

Compare an optional object with a value for equality.

template<
    class t_LHS_TYPE,
    class t_RHS_TYPE>
constexpr
bool
operator==(
    t_LHS_TYPE const& lhs,
    bsl::optional<t_RHS_TYPE> const& rhs);
» more...

Return whether the operands have the same value.

template<
    class t_LHS_TYPE,
    class t_RHS_TYPE>
constexpr
bool
operator==(
    std::optional<t_LHS_TYPE> const& lhs,
    bsl::optional<t_RHS_TYPE> const& rhs);
» more...

Compare a std::optional with a bsl::optional for equality.

template<
    class t_LHS_TYPE,
    class t_RHS_TYPE>
constexpr
bool
operator==(
    bsl::optional<t_LHS_TYPE> const& lhs,
    std::optional<t_RHS_TYPE> const& rhs);
» more...

Return true if the specified lhs and rhs objects have the same value, and false otherwise.

bool
operator==(
    unordered_multiset<KEY2, HASH2, EQUAL2, ALLOCATOR2> const& lhs,
    unordered_multiset<KEY2, HASH2, EQUAL2, ALLOCATOR2> const& rhs);
» more...

Return true if lhs and rhs have the same value.

template<
    class KEY,
    class HASH,
    class EQUAL,
    class ALLOCATOR>
bool
operator==(
    unordered_multiset<KEY, HASH, EQUAL, ALLOCATOR> const& lhs,
    unordered_multiset<KEY, HASH, EQUAL, ALLOCATOR> const& rhs);
» more...

Return Value

  • true if the iterators refer to the same element
  • true if equal, otherwise false
  • true if the unordered multimaps compare equal
  • true if the deques compare equal
  • true if the stacks have the same value, false otherwise
  • true if lhs and rhs are equal
  • true if the queues have the same value, otherwise false
  • true if the lists compare equal
  • true if the iterators refer to the same node
  • true if the hash tables contain the same elements
  • true if the hash sets contain the same elements
  • true if the hash multisets contain the same elements
  • true if the lists are equal, and false otherwise
  • true if the hash maps contain the same elements
  • true if the hash multimaps contain the same elements
  • true if both refer to the same stop state (or neither)
  • true if lhs and rhs compare equal, and false otherwise
  • true if the operands compare equal, and false otherwise
  • true if the vectors have the same value, and false otherwise
  • true if the vectors have the same value, and false otherwise
  • true if the strings compare equal
  • true if lhs and rhs refer to the same object
  • true if lhs does not refer to an object
  • true if the maps compare equal
  • true if the multimaps compare equal
  • true if the sets compare equal
  • true if the pairs have the same value, and false otherwise
  • true if f is empty, and false otherwise
  • true if lhs and rhs have the same value, and false otherwise
  • true if value is disengaged, and false otherwise

Parameters

NameDescription
lhsfirst iterator to compare
rhssecond iterator to compare
__xleft-hand iterator
__yright-hand iterator
__hm1first hash table
__hm2second hash table
_SL1first list compared
_SL2second list compared
nullPointerLiteralnull-pointer literal (unused; selects this overload)
ffunction object to compare with null
unusednull pointer literal
valuevalue compared with or used to initialize the optional
nulloptdisengaged-optional tag; value is unused