digitalmars.D - Idea for "scope" keyword
- "Craig Black" <cblack ara.com> Nov 29 2006
- Sean Kelly <sean f4.ca> Nov 29 2006
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;
}
-Craig
Nov 29 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
Nov 29 2006








Sean Kelly <sean f4.ca>