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.
Return true if the specified lhs and rhs objects have the same value, and false otherwise.
Return true if the specified lhs and rhs objects have the same value, and false otherwise. Two unordered_set objects have the same value if they have the same number of value‐elements, and for each value‐element that is contained in lhs there is a value‐element contained in rhs having the same value, and vice‐versa. Note that this method requires that the (template parameter) type KEY be equality‐comparable (see {Requirements on KEY}).
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);
Return true if the specified lhs and rhs objects have the same value, and false otherwise.
Return true if the specified lhs and rhs objects have the same value, and false otherwise. Two unordered_map objects have the same value if they have the same number of key‐value pairs, and for each key‐value pair that is contained in lhs there is a key‐value pair contained in rhs having the same value, and vice versa. Note that this method requires that the (template parameter) types KEY and VALUE both be equality‐comparable (see {Requirements on value_type}).
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);
Same as the related overload above for operator==.
Return true if the specified lhs and rhs objects have the same value, and false otherwise. Two unordered_multimap objects have the same value if they have the same number of key‐value pairs, and each key‐value pair that is contained in one of the objects is also contained in the other object. This method requires that the (template parameter) types KEY and VALUE both be equality‐comparable (see {Requirements on KEY and 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);
Return true if the specified lhs and rhs objects have the same value, and false otherwise. Two deque objects lhs and rhs have the same value if they have the same number of elements, and each element in the ordered sequence of elements of lhs has the same value as the corresponding element in the ordered sequence of elements of rhs. This method requires that the (template parameter) type VALUE_TYPE be equality‐comparable (see {Requirements on VALUE_TYPE}).
template<
class VALUE_TYPE,
class ALLOCATOR>
bool
operator==(
deque<VALUE_TYPE, ALLOCATOR> const& lhs,
deque<VALUE_TYPE, ALLOCATOR> const& rhs);
Same as the related overload above for operator==.
bool
operator==(
stack<VAL, CONT> const&,
stack<VAL, CONT> const&);
Return true if the specified lhs and rhs objects have the same value, and false otherwise. Two stack objects lhs and rhs have the same value if they have the same number of elements, and each element in the ordered sequence of elements of lhs has the same value as the corresponding element in the ordered sequence of elements of rhs. This method requires that the (template parameter) type VALUE be equality‐comparable (see {Requirements on VALUE}).
template<
class VALUE,
class CONTAINER>
bool
operator==(
stack<VALUE, CONTAINER> const& lhs,
stack<VALUE, CONTAINER> const& rhs);
Return true if the specified lhs and rhs are both valueless by exception or if they have the same active alternative and their contained values compare equal; otherwise, return false. All alternatives shall support operator==.
template<
class t_HEAD,
class... t_TAIL>
bool
operator==(
variant<t_HEAD, t_TAIL...> const& lhs,
variant<t_HEAD, t_TAIL...> const& rhs);
Return whether the specified queues have the same value; see the non‐member operator== in the bsl namespace.
bool
operator==(
queue<VALUE2, CONTAINER2> const&,
queue<VALUE2, CONTAINER2> const&);
Return true if the specified lhs and rhs objects have the same value, and false otherwise. Two queue objects lhs and rhs have the same value if they have the same number of elements, and each element in the ordered sequence of elements of lhs has the same value as the corresponding element in the ordered sequence of elements of rhs. This method requires that the (template parameter) type VALUE be equality‐comparable (see {Requirements on VALUE}).
template<
class VALUE,
class CONTAINER>
bool
operator==(
queue<VALUE, CONTAINER> const& lhs,
queue<VALUE, CONTAINER> const& rhs);
Return true if the specified lhs and rhs objects have the same value, and false otherwise. Two unordered_multiset objects have the same value if they have the same number of value elements, and for each value‐element that is contained in lhs there is a value‐element contained in rhs having the same value, and vice‐versa. Note that this method requires that the (template parameter) type KEY be equality‐comparable (see {Requirements on KEY}).
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);
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);
Return true if the specified lhs and rhs objects have the same value, and false otherwise. Two list objects lhs and rhs have the same value if they have the same number of elements, and each element in the ordered sequence of elements of lhs has the same value as the corresponding element in the ordered sequence of elements of rhs. This method requires that the (template parameter) type VALUE be equality‐comparable (see {Requirements on VALUE}).
template<
class VALUE,
class ALLOCATOR>
bool
operator==(
list<VALUE, ALLOCATOR> const& lhs,
list<VALUE, ALLOCATOR> const& rhs);
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);
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);
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);
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);
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);
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);
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);
Return true if the specified lhs and rhs refer to the same stop state, or if neither refers to a stop state; false otherwise. Implementation note: this function is required by the standard to be a hidden friend ([hidden.friends], [stopsource.general]).
[[nodiscard]]
bool
operator==(
stop_source const& lhs,
stop_source const& rhs) noexcept;
Return true if the specified lhs and rhs refer to the same stop state, or if neither refers to a stop state; false otherwise. Implementation note: this function is required by the standard to be a hidden friend ([hidden.friends], [stoptoken.general]).
[[nodiscard]]
bool
operator==(
stop_token const& lhs,
stop_token const& rhs) noexcept;
Return true if the specified lhs and rhs objects have the same value, and false otherwise. Two multimap objects lhs and rhs have the same value if they have the same number of key‐value pairs, and each element in the ordered sequence of key‐value pairs of lhs has the same value as the corresponding element in the ordered sequence of key‐value pairs of rhs. This method requires that the (template parameter) types KEY and VALUE both be equality‐comparable (see {Requirements on KEY and 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);
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 of the same sequence, and false otherwise. The behavior is undefined if lhs and rhs do not iterate over the same sequence.
bool
operator==(
vector_UintPtrConversionIterator const& lhs,
vector_UintPtrConversionIterator const& rhs);
Return true if the specified lhs and rhs objects have the same value, and false otherwise. Two vector objects lhs and rhs have the same value if they have the same number of elements, and each element in the ordered sequence of elements of lhs has the same value as the corresponding element in the ordered sequence of elements of rhs. This method requires that the (template parameter) type VALUE_TYPE be equality‐comparable (see {Requirements on VALUE_TYPE}).
template<
class VALUE_TYPE,
class ALLOCATOR>
bool
operator==(
vector<VALUE_TYPE, ALLOCATOR> const& lhs,
vector<VALUE_TYPE, ALLOCATOR> const& rhs);
Return true if the specified lhs and rhs vectors have the same value, and false otherwise.
bool
operator==(
vector const& lhs,
vector const& rhs);
Return true if the specified lhs and rhs vectors have the same value, and false otherwise.
bool
operator==(
vector<void*> const& lhs,
vector<void*> const& rhs);
Return true if the specified lhs and rhs vectors have the same value, and false otherwise.
bool
operator==(
vector<char const*> const& lhs,
vector<char const*> const& rhs);
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;
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;
Return true if the specified lhs string has the same value as the specified rhs string, and false otherwise. Two strings have the same value if they have the same length, and the characters at each respective position have the same value according to CHAR_TRAITS::eq.
template<
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOC>
bool
operator==(
basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOC> const& lhs,
CHAR_TYPE const* rhs);
Return true if the specified lhs shared pointer refers to the same object (if any) as that referred to by the specified rhs shared pointer (if any), and false otherwise; a compiler diagnostic will be emitted indicating the error unless a (raw) pointer to LHS_TYPE can be compared to a (raw) pointer to RHS_TYPE. Note that two shared pointers that compare equal do not necessarily manage the same object due to aliasing.
template<
class LHS_TYPE,
class RHS_TYPE>
bool
operator==(
shared_ptr<LHS_TYPE> const& lhs,
shared_ptr<RHS_TYPE> const& rhs) noexcept;
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) noexcept;
Return true if the specified lhs and rhs objects have the same value, and false otherwise. Two map objects lhs and rhs have the same value if they have the same number of key‐value pairs, and each element in the ordered sequence of key‐value pairs of lhs has the same value as the corresponding element in the ordered sequence of key‐value pairs of rhs. This method requires that the (template parameter) types KEY and VALUE both be equality‐comparable (see {Requirements on KEY and 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);
Return true if the specified lhs and rhs pair objects have the same value and false otherwise. lhs has the same value as rhs if lhs.first == rhs.first and lhs.second == rhs.second. A call to this operator will not compile unless both T1 and T2 supply operator==.
template<
class T1,
class T2>
constexpr
bool
operator==(
pair<T1, T2> const& lhs,
pair<T1, T2> const& rhs);
Return true if the specified lhs and rhs objects have the same value, and false otherwise. Two set objects lhs and rhs have the same value if they have the same number of keys, and each element in the ordered sequence of keys of lhs has the same value as the corresponding element in the ordered sequence of keys of rhs. This method requires that the (template parameter) type KEY be equality‐comparable (see {Requirements on KEY}).
template<
class KEY,
class COMPARATOR,
class ALLOCATOR>
bool
operator==(
set<KEY, COMPARATOR, ALLOCATOR> const& lhs,
set<KEY, COMPARATOR, ALLOCATOR> const& rhs);
Return true if the specified lhs and rhs objects have the same value, and false otherwise. Two multiset objects lhs and rhs have the same value if they have the same number of keys, and each element in the ordered sequence of keys of lhs has the same value as the corresponding element in the ordered sequence of keys of rhs. This method requires that the (template parameter) type KEY be equality‐comparable (see {Requirements on KEY}).
template<
class KEY,
class COMPARATOR,
class ALLOCATOR>
bool
operator==(
multiset<KEY, COMPARATOR, ALLOCATOR> const& lhs,
multiset<KEY, COMPARATOR, ALLOCATOR> const& rhs);
Return true if the specified function argument is empty, otherwise return false.
template<class PROTOTYPE>
bool
operator==(
function<PROTOTYPE> const& f,
nullptr_t) noexcept;
Return true if the function argument is empty, otherwise return false.
template<class PROTOTYPE>
bool
operator==(
nullptr_t,
function<PROTOTYPE> const& f) noexcept;
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.
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);
Return true if the specified value is disengaged, and false otherwise. This function can be called in constant expressions only if t_TYPE is not allocator‐aware.
template<class t_TYPE>
constexpr
bool
operator==(
bsl::optional<t_TYPE> const& value,
bsl::nullopt_t const&) noexcept;
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.
template<
class t_LHS_TYPE,
class t_RHS_TYPE>
constexpr
bool
operator==(
bsl::optional<t_LHS_TYPE> const& lhs,
t_RHS_TYPE const& rhs);
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);
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.
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);
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);
Return true if the specified lhs and rhs objects have the same value, and false otherwise.
Created with MrDocs