On Mon, 23 Jul 2012 08:32:37 +0200, Philippe Sigaud
<philippe.sig...@gmail.com> wrote:
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);
}
Wrong way around. Try this:
template Twice(double d)
{
enum Twice = d * 2;
}
double foo(double d)
{
return Twice!d;
}
void main()
{
enum t = foo(1.0);
pragma(msg, t);
}
--
Simen