When do you use templates instead of CTFE?

James Miller james at aatch.net
Sun Mar 25 16:39:36 PDT 2012


On 26 March 2012 12:35, Jonathan M Davis <jmdavisProg at gmx.com> wrote:
> On Sunday, March 25, 2012 17:55:56 Nick Sabalausky wrote:
>> Yea, the general rule of thumb is "If you can do it with CTFE, then do so,
>> otherwise use templates."
>
> Generally, you end up having to use templates for stuff that operates on
> types, whereas CTFE works for stuff that can be normal functions.
>
> - Jonathan M Davis

Often I end up using the same function in CTFE and runtime.

--
James Miller


More information about the Digitalmars-d mailing list