On heap segregation, GC optimization and @nogc relaxing

deadalnix via Digitalmars-d digitalmars-d at puremagic.com
Fri Nov 14 15:12:32 PST 2014


On Friday, 14 November 2014 at 20:22:13 UTC, Marc Schütz wrote:
> It needs to be `owned(Exception)`, otherwise, how could the 
> compiler know how to treat it correctly? But declaring foo() in 
> that way would be unhelpful, because it would move the 
> exception on calling the function, which is usually not 
> desired. What you want here, instead, is borrowing:
>
>     void foo(T)(scope(T) arg) {
>         pragma(msg, T);
>     }

That is a very good question. I do think this should show the 
type of T, without owned qualifier.


More information about the Digitalmars-d mailing list