mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-08-03 08:20:28 +00:00
Switch to p
This commit is contained in:
parent
a9fb3193d1
commit
a3f913b20b
1 changed files with 4 additions and 4 deletions
|
@ -71,7 +71,7 @@ struct unique_ptr
|
|||
|
||||
inline void reset(nullptr_t = nullptr) noexcept
|
||||
{
|
||||
if (*this)
|
||||
if (p)
|
||||
d(p);
|
||||
p = nullptr;
|
||||
}
|
||||
|
@ -81,7 +81,7 @@ struct unique_ptr
|
|||
/* requires is_convertible_v<U, T> */
|
||||
inline void reset(U* p2)
|
||||
{
|
||||
if (*this) {
|
||||
if (p) {
|
||||
d(p);
|
||||
}
|
||||
p = static_cast<pointer>(p2);
|
||||
|
@ -117,14 +117,14 @@ struct unique_ptr
|
|||
inline element_type& operator*() const
|
||||
noexcept(noexcept(*std::declval<pointer>()))
|
||||
{
|
||||
if (!*this)
|
||||
if (!p)
|
||||
__builtin_trap();
|
||||
return *p;
|
||||
}
|
||||
|
||||
inline pointer operator->() const noexcept
|
||||
{
|
||||
if (!*this)
|
||||
if (!p)
|
||||
__builtin_trap();
|
||||
return p;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue