Truly @nogc Exceptions?

Neia Neutuladh neia at ikeran.org
Thu Sep 20 18:07:54 UTC 2018


On Thursday, 20 September 2018 at 15:52:15 UTC, H. S. Teoh wrote:
> Yeah, that's what I meant. :D  Well, for backward compatibility 
> we could still have .msg allocate and return a string, but we 
> could provide an overload / alternate member function that 
> writes directly to a sink instead.  Then we don't ever have to 
> allocate unless the sink itself does.

I believe Tango did this a decade ago. It's a solid strategy. 
However, with Tango, the default was to implement the 
toString(sink) function by calling the regular toString(), which 
was quite convenient but won't work with @nogc.


More information about the Digitalmars-d mailing list