Scope statement

Lars V nospamplease at nospam.com
Tue Feb 5 13:37:56 PST 2008


Hi, 

I have a question: 

void foo() 
{ 
  Obj o = new Obj(); 
}

In this code, the destructor of the object will be called ALWAYS at the end of the function? 

In D, the objects are not destroyed when they go out of their scopes??? Is necessary to use the "scope" statement? 

I really don't understand the necessity of the scope statement... could anybody explain it?

Thanks, 
Regards



More information about the Digitalmars-d-learn mailing list