Proposal for design of 'scope' (Was: Re: Opportunities for D)

Jacob Carlborg via Digitalmars-d digitalmars-d at puremagic.com
Thu Jul 10 23:56:10 PDT 2014


On 10/07/14 20:15, H. S. Teoh via Digitalmars-d wrote:

> 	class C {}
> 	C myFunc(C obj) {
> 		obj.doSomething();
> 		return obj; // will be rejected if parameters are scoped by default
> 	}

Hmm, why wouldn't that work? The scope where you called "myFunc" is 
guaranteed to outlive "myFunc".

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list