On 7/10/11 3:29 PM, Simen Kjaeraas wrote:
I'm trying to have this sort of code compile:

////////////////
struct Foo {
int data;
this(int n) {
data = n;
}
}

void bar(Foo f) {}

bar(3);
////////////////

Is this even possible?

If I remember correctly, Walter said that this is a deliberate limitation the last time I asked (when implementing my units of measurement library). I think the intention is to avoid confusion about what is actually going on behind the scenes, like it is possible in C++ with implicitly called constructors.

David

Reply via email to