On Tue, 04 Feb 2014 19:42:55 -0500, bearophile <[email protected]> wrote:

Andrei Alexandrescu:

auto x = fun().toGC();

Recently I remember Kenji saying that we are now almost able to implement "dup" in library code. If that happens, why don't you call it "dup"?

No, toGC does not create a copy. It just detaches the RC component, and relies on GC to clean up the resulting slice (I assume typeof(fun().toGC()) == T[])

dup would imply that you wanted a copy in addition to the reference-counted version. In fact, you may want a copy that is also reference counted.

-Steve

Reply via email to