Return whether lhs and rhs refer to the same object.
Synopsis
Declared in <bslstl_sharedptr.h>
template<
class LHS_TYPE,
class RHS_TYPE>
bool
operator==(
shared_ptr<LHS_TYPE> const& lhs,
shared_ptr<RHS_TYPE> const& rhs) noexcept;
Description
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.
Return Value
true if lhs and rhs refer to the same object
Parameters
Name |
Description |
lhs |
left‐hand side operand |
rhs |
right‐hand side operand |
Created with MrDocs