Rvalue references - The resolution

Walter Bright newshound2 at digitalmars.com
Sat May 4 15:30:34 PDT 2013


On 5/4/2013 3:03 PM, deadalnix wrote:
>> Where you miss the point, is that these annotations may be omitted (and they
>> are most of the time). When nothing is specified, the lifetime of the returned
>> reference is considered to be the union of the lifetime of parameters
>> lifetime, which is what you want in 99% of cases.
>
> Note : We may also choose the lack of explicit lifetime means runtime check as
> proposed, instead of being an error.

D omits the check when it can prove that the returned ref is not a ref to one of 
the parameters that is local.

My other comments about 'scope ref' in the first posting in this thread apply as 
well to the Rust annotation scheme.


More information about the Digitalmars-d mailing list