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 = new Struct();
    delete s;

    writeln("----------------");

}

will printf :
struct
----------------

But in
void main()
{

    auto s = new Struct();
    s.destroy;
    GC.free(s);

    writeln("----------------");

}

will printf :
----------------
struct

If I only GC.free(s); only printf: ----------------

so, I want to know why don't destroy direct printf ?

Reply via email to