On Monday, 18 July 2016 at 17:35:29 UTC, Stefan Koch wrote:

I did it for function templates just now.
It will the instantiated bodys to std-out.

Okay here is the frist really hacky draft patch

In dtemplate.d line 6691 right at the end of semantic3 insert the following code :

        if (auto a = toAlias2) {
            scope hgs = HdrGenState();
            scope ob = OutBuffer();
            scope ppv = new PrettyPrintVisitor(&ob, &hgs);

            if (auto fd = a.isFuncDeclaration()) {
                printf("FunctionTemplate: %s\n{", toChars);
                if (auto fb = fd.fbody)
                    fb.accept(ppv);
            }

            printf("%.*s\n}\n", ob.size, cast(char*)ob.data);

        }
    }

Without warranty of any kind of course :)


Reply via email to