In C++, they provide a mechanism to initialize class variables to a passed value.

class Test
{
        int bob;

public:
        Test(int jessica) : bob(jessica) { }
};

The above basically says "int this.bob = jessica;" as opposed to this:

class Test
{
        int bob;
public:
        Test(int jessica) { bob = jessica; }
};

which basically says "int this.bob = void; bob = jessica;". Now, I'm not a speed freak but this is a quick and should be a painless optimization. D allows defaults set by the class but cannot seem to find anything to allow me variable initialization values. Not that it's that big of a deal but am I missing something?

Reply via email to