clear initializing constructor

Saaa empty at needmail.com
Mon Aug 4 10:40:21 PDT 2008


How do you do something like this?

class Fruit
{

protected struct _Eigen
{
byte color = GREEN;
bool rotten = false;
}
private _Eigen eigen;

this(...)
{
 // ?
}

}

apple=new Fruit(color=RED,rotten=false);
apple2=new Fruit(rotten=true);
apple3=new Fruit(pit=false); //pit=ignored





More information about the Digitalmars-d-learn mailing list