usable @nogc Exceptions with Mir Runtime

9il ilyayaroshenko at gmail.com
Wed Oct 31 08:34:08 UTC 2018


On Tuesday, 30 October 2018 at 16:25:12 UTC, Oleg 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?

The C++ format style is simpler to implement and it is much 
faster to run.
D's style came from C and Boost's format. Also, the C++ style is 
more low level then format strings, so they can be built on top 
of it.


More information about the Digitalmars-d-announce mailing list