void func(T : int)(T value) if (is(T == int)) { } struct S { int x; alias x this; }
void main() { func(S()); // error }In above code, 'func' can accept only int as its argument type, so when 'S', which can be implicitly convertible into int, is passed on 'func', I expect S.x is passed, but this function call is failed.
Is there any way to solve it with keeping 'func' template function?