recursive template at ctfe

bearophile bearophileHUGS at lycos.com
Tue Nov 26 12:28:59 PST 2013


bioinfornatics:

> I wrote some template to compute at compile time how many bits 
> is need for a number x. http://www.dpaste.dzfl.pl/99a842fd
>
> That works for small number but after i got an error about 
> limit recursion

Instead of template recursion, have you tried regular code run at 
compile time?

http://graphics.stanford.edu/~seander/bithacks.html#IntegerLogObvious

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list