Templates vs CTFE

Max Samukha spambox at d-coding.com
Fri Jan 7 04:55:41 PST 2011


On 01/06/2011 09:28 PM, Robert Clipsham wrote:
>
> Put each of those implementations in its own file, then call it several
> times. Look at the binary size for each implementation, also run
> `strings ctfeTest` if you're on a *nix. This should give you your answer :)
>

The problem is they are not easy to compare using artificial tests. For 
example, there is a hard-wired limit to template nesting depth in the 
compiler. And with the number of input elements less than this limit, 
the difference in results seems to be insignificant.

BTW, if we want to be taken seriously such limits should be 
configurable. Why the depth of 500 and not 600? I wonder where the value 
comes from.

Ok, I think I will simply implement both variants and let the user 
choose. Thanks for the responses.




More information about the Digitalmars-d mailing list