On Wednesday, 4 September 2013 at 20:25:28 UTC, ilya-stromberg wrote:
So, the question is: what should I add to "Foo" struct to allow implicit conversions from "int" to "Foo"?

D does not support implicit struct construction.

Interestingly though, it *does* support it for functions taking classes:

class Foo {
        this(int i) {}
}

void foo(Foo f...) {}

void main() {
        foo(10);
}


But there's nothing like it for structs.

Reply via email to