Compile time function execution...

Walter Bright newshound at digitalmars.com
Fri Feb 16 14:53:11 PST 2007


Michiel wrote:
> Dave wrote:
>>> int foo = square(5);
>>>
>>> does work. I knew I'd never get it right the first try :-(
>> Wait -- int foo = square(5); is supposed to CTFE? If so that'd be awesome.
> 
> I don't think so. If I'm not mistaken, D would do that at runtime at the
> moment.
> 

Not for a global declaration, which must happen at compile time.



More information about the Digitalmars-d mailing list