On Tuesday, 18 July 2017 at 11:47:37 UTC, Petar Kirov [ZombineDev] wrote:
I think Atila was talking about this one:
struct A
{
        ~this() {}
}

void main()
{
        auto a = A();
        shared b = A();
}


Shouldn't it be :
struct A
{
    ~this() shared {}
}

void main()
{
    auto a = A();
    shared b = A();
}
?

Because handling theard-local data as shared is safe as far as I remember, but not the other way round.

And if you want a destructor which works with both immutable and normal, shouldn't it be a const destructor?

Reply via email to