Template/mixin ideas?

Sebastiaan Koppe mail at skoppe.eu
Fri Oct 5 07:59:08 UTC 2018


On Thursday, 4 October 2018 at 01:12:04 UTC, Chris Katko wrote:
> The mixin part wouldn't be slowed by strings, right? So the 
> "slowness" is the invokation part which changes strings and 
> forces GC allocations, I guess?
Yep, that is right.

> What's the alternative to using strings... for strings?
During the concatenation phase you'll use an Appender. Afterwards 
you retrieve the resulting string from the appender. It is very 
similar to a StringBuilder in other languages.

See std.array.appender


More information about the Digitalmars-d-learn mailing list