Templates vs CTFE

so so at so.do
Fri Jan 7 04:36:54 PST 2011


Actually they are not that related, you may solve a problem with each of  
them but this is different.
What makes CTFE awesome is that you use same function for runtime and  
compile-time, without a single change.
The answer to your question is just in this very definition i believe.

> It is not easy to decide which approach to implement in a library  
> because both have drawbacks.
And one fills the holes of the other.

> Can anybody give informed advice as to which one is preferable in  
> practice? Or should a library provide both?
I can't guarantee the "informed" part but,
Between your two implementations it is obvious which one, after you answer  
the question:
What you want it to be, runtime? compile-time? both?


More information about the Digitalmars-d mailing list