mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-12 14:09:12 +00:00
Fix shared_ptr<T>::owner_before
!(a < b) is not the same as b < a. I think I originally wrote it this way to avoid making weak_ptr a friend of shared_ptr, but weak_ptr already is a friend.
This commit is contained in:
parent
5eb7cd6643
commit
7583c8f769
1 changed files with 1 additions and 1 deletions
|
@ -349,7 +349,7 @@ class shared_ptr
|
|||
template<typename U>
|
||||
bool owner_before(const weak_ptr<U>& r) const noexcept
|
||||
{
|
||||
return !r.owner_before(*this);
|
||||
return rc < r.rc;
|
||||
}
|
||||
|
||||
private:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue