Static Constructors

Saaa empty at needmail.com
Sat Oct 4 13:00:30 PDT 2008


What would happen here?
Would the GC delete the newly made instances as there is no reference to it?

Fruits fruit[];
class Fruit
{
this( parameters )
{

}
..
void stuff()
{
}
 ..
}

new fruit( .. );
//or can this only be called if there is an static constructor?
new fruit( .. );

foreach (f; fruit)
  f.stuff();
//fruit is empty.




More information about the Digitalmars-d-learn mailing list