example for compile time function execution

Benji Smith dlanguage at benjismith.net
Sun Apr 29 07:09:49 PDT 2007


Walter Bright wrote:
> I keep racking my brain trying to come up with a short, pithy example of 
> CTFE that uses AAs or struct literals. It should be just a few lines, 
> and make it clear why CTFE is a great thing. I want to use it in 
> presentations.
> 
> Any ideas?

I think compile-time syntax checking of SQL strings, for a particular 
database engine, would be incredibly useful. Or maybe compile-time regex 
syntax checking.

I don't know whether those examples would use AAs or struct literals, 
but they'd be damn useful.

--benji



More information about the Digitalmars-d mailing list