https://issues.dlang.org/show_bug.cgi?id=17065

Martin Nowak <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #5 from Martin Nowak <[email protected]> ---
I'm for reverting this change (the Proxy part).

Proxy is a horrible hack that employ a giant template machinery and was only
introduced to replace typedef. It's main difference from alias this being, that
you cannot implicitly convert it to the type.

Unique should work like this, but cannot until -dip1000 became default.

static if (class_or_interface)
    T get() return scope { return _p; }
else
    ref T get() return { return *_p; }

alias this get;

This does allow implicit conversion, but binds the lifetime of the returned
class ref/ref to the lifetime of Unique, thus making it impossible to escape.

It'll still take a while until that works, and we're likely to come up with new
RC implementations after that (b/c both Unique and RefCounted leave a lot to
wish).

Also opDot isn't going away for a while (and maybe be could be replaced with
opDispatch).

See https://trello.com/c/pTlDuyBD/31-finish-smartref-implementation for
previous attempts on fixing Unique/RefCounted.

--

Reply via email to