Idea for "scope" keyword

Sean Kelly sean at f4.ca
Wed Nov 29 10:26:18 PST 2006


Craig Black wrote:
> I thought it was very cool that .175 can instantiate an object on the stack 
> using the scope keyword.  Would it be possible to take this one step further 
> and be able to use this approach on class fields so that they are not 
> instantiated on the heap?  I know you can use structs for this, but I find 
> the limitations of D structs annoying.
> 
> class A {};
> 
> class B
> {
>   scope A a = new A;
> }

I have a feeling this is where Walter is heading with the scope keyword, 
so it's probably just a matter of time.


Sean



More information about the Digitalmars-d mailing list