Making AssertError a singleton

Shachar Shemesh via Digitalmars-d digitalmars-d at puremagic.com
Mon Dec 12 11:57:11 PST 2016


On 12/12/16 17:51, Andrei Alexandrescu wrote:
> Here it is:
>
> https://github.com/dlang/druntime/pull/1710
>
> It relieves code that uses assert from needing the GC. I think all
> Errors should be singletons - multiple objects in that hierarchy
> arguably make no sense. But of course there are many situations out
> there. If this breaks your code, please holler.
>
>
> Andrei

I'll just add that we're not using AssertError anyways. We found that 
the various scope(failure) and scope(exit) that run in such cases 
significantly detract from the ability to debug what actually happened.

Our assert immediately terminates the process.

Shachar


More information about the Digitalmars-d mailing list