I've tried the following code and I get the error:

Error: template Foo(A) does not have property 'of'


struct Foo(A)
{
        private int _foo;

        @disable this();

        public this(int foo)
        {
                this._foo = foo;
        }

        public static auto of(B)()
        {
                return Foo!(B)(8);
        }
}

void main(string[] args)
{
        auto foo = Foo.of!(string);
}


Is it possible to even have static methods on structs like this? What am I doing wrong?

Reply via email to