On 15/07/14 01:48, H. S. Teoh via Digitalmars-d wrote:
Yes, but since the extent of this scope is unknown from inside the
function body, it doesn't easily lend itself nicely to check things like
this:
int* ptr;
void func(scope int* arg) {
ptr = arg; // should this be allowed?
}
If we only know that 'arg' has a longer lifetime than func, but we don't
know how long it is, then we don't know if it has the same lifetime as
'ptr', or less. So it doesn't really let us do useful checks.
I was thinking that "arg" would have at least the same lifetime as the
caller, i.e. the same as "ptr".
--
/Jacob Carlborg