Changeset 383

Show
Ignore:
Timestamp:
07/05/08 17:23:02 (5 months ago)
Author:
FeepingCreature
Message:
  • Small operator improvement to /or/
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/tools/tools/base.d

    r382 r383  
    10591059    return res; 
    10601060  } 
     1061  bool opIn_r(U)(U other) { 
     1062    bool res = !!(other in values[0]); 
     1063    foreach (value; values[1 .. $]) 
     1064      res = mixin("res "~OP~" !!(other in value)"); 
     1065    return res; 
     1066  } 
    10611067} 
    10621068 
     
    10991105  mustEqual("BoolSetTestOr", 2 /or/ 3 == 3, true); 
    11001106  mustEqual("BoolSetTestAnd", AndSet(2, 3) == 3, false); 
    1101   mustEqual("RangeInclTest", 5 in Range[2..5].endIncl, true); 
     1107  mustEqual("RangeInclTest", 5 in Range[1..3].endIncl /or/ Range[2..5].endIncl, true); 
    11021108} 
    11031109