C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Delete...why not a parameter by reference?!

From: Jonathan Wakely <cxx_at_[hidden]>
Date: Sat, 23 Aug 2025 14:23:03 +0100
On Sat, 23 Aug 2025, 11:35 organicoman, <organicoman_at_[hidden]> wrote:

>
>
>
>
> Sent from my Galaxy
>
>
>
>
> So stop using raw pointers like this then.
>
> You have to say so to all major stl library providers, because it is
> pointers all over the place.
>


But do those cases lead to use-after-free? Would zeroing out those pointers
help fix any bugs?


If the uses in the standard library are already correct, your proposal
won't help them. If you have similar problems in your own code, don't use
raw pointers in your own code.




> Finally, a delete expression that nulls out the pointer, is a useful
> addition. so many times I find myself doing it, to avoid any misconception.
>
>>
>>

Received on 2025-08-23 13:23:22