Joseph Rushton Wakeling:

Full example code attached, just for clarity.


Like this?


T2 func(T, T2)(T foo, T2 x) if (is(T2 == T.T1)) {
    return x * foo.a;
}

void main() {
    auto foo = new Foo!(size_t, real)(3, 2.5);
    size_t y = 4;
    writeln(foo.func(y));
}


Bye,
bearophile

Reply via email to