Re: about destroy and delete.

2016-04-21 Thread Dsby via Digitalmars-d
On Wednesday, 20 April 2016 at 09:00:41 UTC, Daniel Kozak wrote: On Wednesday, 20 April 2016 at 08:10:15 UTC, Dsby wrote: I see https://dlang.org/deprecate.html#delete ... so, I want to know why don't destroy direct printf ? if you call destroy on struct pointer it is same as assign null to

Re: about destroy and delete.

2016-04-20 Thread Marco Leise via Digitalmars-d
The semantics of `delete` from C++ are pretty clear. It is meant for dynamically allocated memory. destroy(…) however is a generic tool that brings the thing you pass in back to an initial state. For pointers, null is assigned, for structs and classes (which are not pointers but references) the

Re: about destroy and delete.

2016-04-20 Thread Lass Safin via Digitalmars-d
On Wednesday, 20 April 2016 at 08:10:15 UTC, Dsby wrote: I see https://dlang.org/deprecate.html#delete The delete will be removeed, when will be deprecate? and i test destroy/GC.free and delte in struct, the value is difference; struct Struct { string value = "struct"; ~this() {

Re: about destroy and delete.

2016-04-20 Thread Daniel Kozak via Digitalmars-d
On Wednesday, 20 April 2016 at 08:10:15 UTC, Dsby wrote: I see https://dlang.org/deprecate.html#delete ... so, I want to know why don't destroy direct printf ? if you call destroy on struct pointer it is same as assign null to it so destroy(s) is same as s = null; OK it is more like s =

Re: about destroy and delete.

2016-04-20 Thread Dsby via Digitalmars-d
And ,will destroy mark the memory in GC to be free?

about destroy and delete.

2016-04-20 Thread Dsby via Digitalmars-d
I see https://dlang.org/deprecate.html#delete The delete will be removeed, when will be deprecate? and i test destroy/GC.free and delte in struct, the value is difference; struct Struct { string value = "struct"; ~this() { writeln(value); } } void main() { auto