Time for std.reflection

Philippe Sigaud philippe.sigaud at gmail.com
Sun Jul 22 23:32:37 PDT 2012


On Sun, Jul 22, 2012 at 5:10 PM, Max Samukha <maxsamukha at gmail.com> wrote:

> The language does not allow you to use CTFE parameter values as arguments to
> __traits/templates. Therefore, to be able to build meta-objects at
> compile-time, you would have to:
>
> static info = getModuleInfo!"std.algorithm";

Maybe I don't get your comment, but AFAICT, the language does allow
you to use CTFE parameters values as arguments to templates:

template Twice(double d)
{
    enum Twice = d * 2;
}

double foo(double d)
{
    return d+1.0;
}

void main()
{
    enum t = Twice!(foo(1.0));
    pragma(msg, t);
}


More information about the Digitalmars-d mailing list