C++ Logo

std-proposals

Advanced search

[std-proposals] delete p = nullptr;

From: Frederick Virchanza Gotham <cauldwell.thomas_at_[hidden]>
Date: Tue, 20 Dec 2022 06:51:11 +0000
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;

The 'delete' operator has higher precedence than assignment, so it
won't be parsed as "delete (p = nullptr)" which would be a problem.

Received on 2022-12-20 06:51:20