A puzzle (easy one)

Koroskin Denis 2korden at gmail.com
Wed Aug 6 18:22:13 PDT 2008


Write a one-line compile-time function (or template) that returns a  
number, which can be written in binary as 010101010...010101. Exactly the  
same code should work for byte, short, int, long, cent etc.

No loops or recursion allowed. Use nothing but brain! :)


More information about the Digitalmars-d-learn mailing list