All right, all right! Interim decision regarding qualified Object methods
schveiguy at yahoo.com
Fri Jul 13 04:47:30 PDT 2012
On Fri, 13 Jul 2012 05:02:30 -0400, F i L <witte2008 at gmail.com> 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.
More information about the Digitalmars-d