Cleanup class after method?

Jonathan M Davis newsgroup.d at jmdavisprog.com
Thu Jul 5 14:14:59 UTC 2018


On Thursday, July 05, 2018 05:47:20 Flaze07 via Digitalmars-d-learn wrote:
> On Wednesday, 4 July 2018 at 16:02:25 UTC, Jonathan M Davis wrote:
> > -dip1000 fully implements scope so that it verifies that no
> > reference escapes, but it's not ready yet, let alone the
> > default behavior.
> >
> > - Jonathan M Davis
>
> I read the proposal about -dip1000 ( not all, some ) and there is
> also a scoped! template in std.typecons, so...is it better to use
> the scope keyword, or scoped! template

Long term, it will be better to use the scope keyword. Short term (i.e.
until -dip1000 is the normal behavior or at least ready to use), it may be
better to use scoped, since I think that the wrapper protects you at least
somewhat - though the main reason that it was originally introduced is that
scope on classes was going to deprecated, because we didn't want something
that unsafe to be a keyword, but DIP 1000 is changing that.

- Jonathan M Davis



More information about the Digitalmars-d-learn mailing list