DIP1000: Scoped Pointers

Dicebot via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Mon Aug 15 05:49:59 PDT 2016


On 08/15/2016 03:41 PM, Rory McGuire via Digitalmars-d-announce wrote:
> scope rnd  = new Rnd; // reference semantic and stack allocated
> auto rnd2 = rnd;
> 
> rnd.i = 2;
> assert(rnd2.i == 2);
> return rnd2;

Point is that that would become illegal if DIP1000 is implemented thus
giving scope class concept more justification. It would still have @safe
holes though because proposed `scope` does not work through many
indirection levels - but better than existing situation when nothing is
checked.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-announce/attachments/20160815/42049675/attachment.sig>


More information about the Digitalmars-d-announce mailing list