mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-08-03 08:20:28 +00:00
Consistently use operator bool
This commit is contained in:
parent
89b9a76b01
commit
5b242f6900
1 changed files with 2 additions and 2 deletions
|
@ -69,7 +69,7 @@ struct unique_ptr
|
|||
|
||||
inline void reset(nullptr_t = nullptr) noexcept
|
||||
{
|
||||
if (d.first())
|
||||
if (*this)
|
||||
d.second()(d.first());
|
||||
d.first() = nullptr;
|
||||
}
|
||||
|
@ -79,7 +79,7 @@ struct unique_ptr
|
|||
/* requires is_convertible_v<U, T> */
|
||||
inline void reset(U* p2)
|
||||
{
|
||||
if (d.first()) {
|
||||
if (*this) {
|
||||
d.second()(d.first());
|
||||
}
|
||||
d.first() = static_cast<pointer>(p2);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue