lemon/bits/utility.h
changeset 2142 b089e7195664
parent 2077 d687c0033bb5
child 2151 38ec4a930c05
equal deleted inserted replaced
1:3907f8887e71 2:0b0fa1206ea2
   104   template <int val>
   104   template <int val>
   105   struct CTEqual<val, val> {
   105   struct CTEqual<val, val> {
   106     static const bool value = true;
   106     static const bool value = true;
   107   };
   107   };
   108 
   108 
   109   template <bool sless, bool sequal, bool bless>
       
   110   struct CTLessImpl {
       
   111    static const bool value =
       
   112    CTOr<sless, CTAnd<sequal, bless>::value>::value;
       
   113   };
       
   114 
   109 
   115   template <int left, int right>
   110   template <int left, int right>
   116   struct CTLess {
   111   struct CTLess {
   117     static const bool value = 
   112     static const bool value = left < right;
   118     CTLessImpl<CTLess<left >> 1, right >> 1>::value, 
       
   119                CTEqual<left >> 1, right >> 1>::value,
       
   120                CTLess<left & 1, right & 1>::value >::value;
       
   121   };
   113   };
   122 
   114 
   123   template <int left>
   115   template <int left>
   124   struct CTLess<left, 0> {
   116   struct CTLess<left, 0> {
   125     static const bool value = false;
   117     static const bool value = false;