scope escaping

Marco Leise Marco.Leise at gmx.de
Thu Feb 6 19:26:23 PST 2014


Am Thu, 06 Feb 2014 21:50:32 +0000
schrieb "Dicebot" <public at dicebot.lv>:

> On Thursday, 6 February 2014 at 20:17:25 UTC, Benjamin Thaut 
> wrote:
> > Another idea. I would totaly love that behaviour.
> >
> > void foo(scope int[] arg) { ... }
> >
> > foo([1 2 3 4]); // allocates the array literal on the stack, 
> > because it is scoped.
> >
> > Kind Regards
> > Benjamin Thaut
> 
> That was basis of old rejected `scope ref` proposal for rvalue 
> references :(

Why would anyone reject this?

-- 
Marco



More information about the Digitalmars-d mailing list