suggestion: relaxing reqirements for version and mixin

Walter Bright newshound1 at digitalmars.com
Tue Apr 3 11:16:43 PDT 2007


Thomas Kuehne wrote:
> if( version(STRICT){a<200 || } a>0){
>     // blabla
> }

version (STRICT)
    const strict = 1;
else
    const strict = 0;

...

if ( (strict && a < 200) || a > 0)
{
     ...
}

Constant folding will take care of eliminating unneeded extra tests.



More information about the Digitalmars-d mailing list