recursive template at ctfe

bioinfornatics bioinfornatics at fedoraproject.org
Tue Nov 26 12:50:12 PST 2013


On Tuesday, 26 November 2013 at 20:29:00 UTC, bearophile wrote:
> 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

Thanks i will take a look


More information about the Digitalmars-d-learn mailing list