RFC: moving forward with @nogc Phobos
Johannes Pfau via Digitalmars-d
digitalmars-d at puremagic.com
Tue Sep 30 09:54:54 PDT 2014
Am Tue, 30 Sep 2014 05:29:55 -0700
schrieb Andrei Alexandrescu <SeeWebsiteForEmail at erdani.org>:
>
> > Another thought: if we use a template parameter, what's the story
> > for virtual functions (e.g. Object.toString)? They can't be
> > templated.
>
> Good point. We need to think about that.
>
Passing buffers or sink delegates (like we already do for toString) is
possible for some functions. For toString it works fine. Then implement
to!RCString(object) using the toString(sink delegate) overload.
For all other functions RC is indeed difficult, probably only possible
with different manually written overloads (and a dummy parameter as we
can't overload on return type)?
More information about the Digitalmars-d
mailing list