struct Foo
{
    int a;
    static Foo opImplicitConstructFrom(T)(T val) if(is(T : int))
    {
        return Foo(val);
    }
}

void test(Foo foo, int i)
{
    assert(foo.a == i);
}

test(42, 42); ->
test(Foo.opImplicitConstructFrom(42), 42);

Reply via email to