On Tue, 20 Dec 2022 at 07:51, Frederick Virchanza Gotham via Std-Proposals <std-proposals@lists.isocpp.org> wrote:
It's common that you'll see the following two lines in C++ code:

    delete p;
    p = nullptr;

How about allowing it as follows?

    delete p = nulltpr;


This is already trivial:

template<class T>
void erase(T*& p)
{
delete std::exchange(p, nullptr);
}

int main()
{
auto p = new foo;
assert(p);
erase(p);
assert(!p);
}