According to [util.smartptr.weak.obs]/4, the weak_ptr::owner_before
strict weak ordering is such that "two shared_ptr
or weak_ptr
instances are equivalent if and only if they share ownership or are both empty."
However, I see nothing in the standard that defines what it means for a weak_ptr
to be empty. Obviously a default-constructed weak_ptr
is empty, and a weak_ptr
constructed from an empty shared_ptr
is empty, but it doesn't seem to be explicitly stated whether an expired weak_ptr
is empty.