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 i
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 dto
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()
{
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 = (St
And ,will destroy mark the memory in GC to be free?
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 s