Is it not possible to have a static function template with the same name as the non-static version?

struct S
{
    int i;

    auto foo(T)(int j) {
        i=j;
    }

    static auto foo(T)(int j) {
        S s;
        s.foo!T(j);
        return s;
    }
}

void main()
{
    auto s = S.foo!bool(1);
}

Error: need 'this' for 'foo' of type '(int j)'

Reply via email to