Templates vs CTFE

Don nospam at nospam.com
Fri Jan 7 05:12:19 PST 2011


Max Samukha wrote:
> 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.

It's about the largest value it can be before a compiler stack overflow 
occurs.




More information about the Digitalmars-d mailing list