It has to be in a single function. Suppose you have a variety of modules each of which has a variety of types. And you need to compose a compile-time string which involves all those types and you need to mix that string in at some point. You can't do that.
On 2012-11-27 12:28, Gor Gyolchanyan wrote:This compiles just fine and prints "10" at compile time:
Basically the most important thing I miss is mutable compile-time
variables. That's it. Everything else can be worked around.
int foo ()
{
int i = 0;
for (; i < 10; i++) {}
return i;
}
enum i = foo();
pragma(msg, i);
--
/Jacob Carlborg