Preliminary submission - std.rational and std.typelist

Philippe Sigaud philippe.sigaud at gmail.com
Sun Oct 7 00:24:01 PDT 2012


On Sat, Oct 6, 2012 at 8:32 PM, Dmitry Olshansky <dmitry.olsh at gmail.com> wrote:

> Your current code may have some bad impact on performance:
> return "(" ~ to!string(res.numerator) ~ "/" ~ to!string(res.denominator) ~
> ")";
>
> Allocates 4 times. ~ operator is convenient shortcut to get job done but
> it's unsuitable for building strings and formatted output.

And the solution is?


More information about the Digitalmars-d mailing list