mutable destructor? WAT???

Steven Schveighoffer via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Aug 29 12:22:09 PDT 2016


On 8/29/16 3:00 PM, Dicebot wrote:
> And this segfaults (on Linux):
>
> void main() @safe
> {
>      auto s = const(S)("abcd");
>      foo(s);
> }
>
> I'd call it a clear bug. Most obvious fix would be to require const
> destructor if non-default destructor is present AND immutable/const
> instance is attempted to be created.

I think this would break a LOT of code. But it may be necessary.

-Steve


More information about the Digitalmars-d-learn mailing list