On Fri, 13 Jul 2012 05:02:30 -0400, F i L <[email protected]> wrote:
I always wondered why toString() wasn't just to!string() in the first place, short of UFCS not being implemented for all types.
toString in itself is wasteful. It allocates a string that will likely be thrown away immediately.
Experience has shown that unnecessary allocations == low performance, at least as far as D is concerned.
Yes, to!string should work, but the method for the object should use a dchar output range as a sink, instead of converting to a string. We can build to!string on top of that.
-Steve
