Duck typing for structs

Ash Logan ash.logior at gmail.com
Thu Oct 21 16:19:55 PDT 2010


On 10/21/2010 12:58 PM, bearophile wrote:
> Just a question. Aren't lines like:
> if (is(typeof(candidate) == const))
> Better as static ifs?
>
> Bye,
> bearophile

Probably they are; this was my first try at compile-time functions, and 
while writing it I kept crossing the line between what could and could 
not be evaluated at compile-time/as a condition to a static if, so I 
made most of the "ifs" non-static until I got it working.

-- Ash


More information about the Digitalmars-d mailing list