A puzzle (easy one)

Frank Benoit keinfarbton at googlemail.com
Thu Aug 7 07:52:00 PDT 2008


Koroskin Denis schrieb:

>> right.
>> template func( T ) { T func = T.max/3; }
> 
> Doesn't work for signed types :P
> But you are close!

template func( T ) { T func = T.min < 0 ? T.max/3*2+1 : T.max/3; }





More information about the Digitalmars-d-learn mailing list