ref for (const) variables

Kagamin via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Mar 18 00:50:19 PDT 2015


On Tuesday, 17 March 2015 at 18:14:48 UTC, Jonathan M Davis wrote:
> How long is the ref returned by getFoo even valid? Maybe it 
> refers to memory
> that gets freed on the next line. The compiler can't know.

The problem is not specific to variables, any reference type has 
that issue.


More information about the Digitalmars-d-learn mailing list