[phobos] Fwd: Re: Ruling out arbitrary cost copy construction?

Steve Schveighoffer schveiguy at yahoo.com
Wed Nov 3 11:59:19 PDT 2010





----- Original Message ----
> From: SHOO <zan77137 at nifty.com>
> 
> (2010/11/03 2:47), Michel Fortin wrote:
> > In  first and second examples, you're taking the address of a local variable. 
>This  is forbidden in @safe code, so I consider this already solved.
> 
> I don't  think so.
> @safe code cannot forbid to bring out the  address:
> http://ideone.com/rMl5i

I believe the plan is for @safe to prevent you from taking the address of any 
stack data.  But I don't know if that is formalized.  Surely, that code should 
be disabled by @safe, because the compiler can deduce the variable escapes its 
scope.

-Steve



      


More information about the phobos mailing list