usable @nogc Exceptions with Mir Runtime

Manu turkeyman at gmail.com
Fri Nov 2 07:00:49 UTC 2018


On Tue, Oct 30, 2018 at 9:30 AM Oleg via Digitalmars-d-announce
<digitalmars-d-announce at puremagic.com> wrote:
>
> Thanks for your work!
>
> > Example
> > =======================
> > ///
> > @safe pure nothrow @nogc
> > unittest
> > {
> >     import mir.exception;
> >     import mir.format;
> >     try throw new MirException(stringBuf() << "Hi D" << 2 <<
> > "!" << getData);
> >     catch(Exception e) assert(e.msg == "Hi D2!");
> > }
> >
> > =======================
>
> I don't understand why you choose C++ format style instead of
> D-style format?

Perhaps this is a stupid question... but there's clearly `new
MirException` right there in that code.
How is this @nogc?


More information about the Digitalmars-d-announce mailing list