Revised Compile Time Arithmetic
authordeba
Fri, 12 May 2006 09:54:58 +0000
changeset 2078123f08422c14
parent 2077 d687c0033bb5
child 2079 7fe378247fea
Revised Compile Time Arithmetic
lemon/bits/utility.h
     1.1 --- a/lemon/bits/utility.h	Fri May 12 09:52:28 2006 +0000
     1.2 +++ b/lemon/bits/utility.h	Fri May 12 09:54:58 2006 +0000
     1.3 @@ -106,18 +106,10 @@
     1.4      static const bool value = true;
     1.5    };
     1.6  
     1.7 -  template <bool sless, bool sequal, bool bless>
     1.8 -  struct CTLessImpl {
     1.9 -   static const bool value =
    1.10 -   CTOr<sless, CTAnd<sequal, bless>::value>::value;
    1.11 -  };
    1.12  
    1.13    template <int left, int right>
    1.14    struct CTLess {
    1.15 -    static const bool value = 
    1.16 -    CTLessImpl<CTLess<left >> 1, right >> 1>::value, 
    1.17 -               CTEqual<left >> 1, right >> 1>::value,
    1.18 -               CTLess<left & 1, right & 1>::value >::value;
    1.19 +    static const bool value = left < right;
    1.20    };
    1.21  
    1.22    template <int left>