On Saturday, 13 April 2013 at 07:57:30 UTC, Nicolas Guillemot wrote:
Classes are instanciated with new, structs are not. The following program compiles:

class A {
        int myVal;

        this(int val) {
                myVal = val;
        }
}

struct B {
        int myVal;

        this(int val) {
                myVal = val;
        }
}

void main() {
        A myA = new A(8);

        B myB = 8;
}

Thanks!

Reply via email to