On 5/20/18 9:49 PM, Manu wrote:
On 20 May 2018 at 17:14, Walter Bright via Digitalmars-d
<[email protected]> wrote:
On 5/20/2018 12:28 PM, Manu wrote:
Is re-initialisation to 'init' part of destruction,
No.
or is it a
separate post-process? (I feel it's a post-process)
Yes, and only for delete.
Why? This doesn't make a lot of sense, since delete is freeing the
memory, it shouldn't matter what state the memory is left in. I would
argue that should only be done in debug mode, and actually, I wonder if
some other kind of sentinel memory pattern should be written instead.
destroy() also seems to do it.
Yes, because destroy leaves the memory available for reuse. This is
intentional.
-Steve