C++ Logo

std-proposals

Advanced search

Re: [std-proposals] delete p = nullptr;

From: Pavel Vazharov <freakpv_at_[hidden]>
Date: Tue, 20 Dec 2022 08:59:27 +0200
How about allowing it as follows?
>
> delete p = nulltpr;
>
If you want one liner you can already do something very close to this
delete std::exchange(ptr, nullptr);

However, I'd say that this functionality should have been already wrapped
in a unique_ptr or some other RAII class.

Received on 2022-12-20 06:59:40