Comparisons

unsigned_int<> suports all the comparison operators. Comparison's can be made against any numerical type.

unsigned_int< 128 > a( 10 ), b( 10 ), c( 20 );

CHECK( a < c  && c > a  );
CHECK( a <= c && c >= a );
CHECK( a <= b && b >= a );
CHECK( c != a  && a != c);

CHECK( 9 < a  && a > 9  );
CHECK( 9 <= a && a >= 9 );
CHECK( 20 > a && a < 20 );
CHECK( 20 >= a && a <= 20 );
CHECK( 10 <= a && a >= 10 );
CHECK( 10 == a && 10 == a );
CHECK( 20 != a && 20 != a );
CHECK( 10 >= a && a <= 10 );

CHECK( a == 10.0 && 10.0 == a);

Test Result: gcc34 Passed, msvc80 Passed, msvc71 Passed

Output

Ok