CTFE - filling an array

2008-12-09 Thread The Anh Tran
Hi, I would like to pre-create a double array, each element is calculated by a function. //- import std.stdio; import std.conv; import std.string; template f(int N) { bool fn(double[] tb) { for (int i = 1; i

Re: CTFE - filling an array

2008-12-09 Thread Christopher Wright
The Anh Tran wrote: static double[N] dd = void; dd is not a compile-time constant. static auto tmp = f!(N).fn(dd); The initializer of tmp must be a compile-time constant, but since dd is not a compile-time constant, you can't use CTFE on fn.