CompileTimeAnd
authordeba
Mon, 03 Oct 2005 10:16:45 +0000
changeset 16964e03a355d2ea
parent 1695 e6f99fe1723f
child 1697 4c593a4096da
CompileTimeAnd
Used by SplitGraphAdaptor
lemon/utility.h
     1.1 --- a/lemon/utility.h	Mon Oct 03 10:14:49 2005 +0000
     1.2 +++ b/lemon/utility.h	Mon Oct 03 10:16:45 2005 +0000
     1.3 @@ -66,6 +66,22 @@
     1.4      static const bool value = false;
     1.5    };
     1.6  
     1.7 +  template <bool left, bool right>
     1.8 +  struct _CompileTimeAnd {
     1.9 +    static const bool value = false;
    1.10 +  };
    1.11 +  
    1.12 +  template <>
    1.13 +  struct _CompileTimeAnd<true, true> {
    1.14 +    static const bool value = true;
    1.15 +  };
    1.16 +
    1.17 +  template <typename Left, typename Right>
    1.18 +  struct CompileTimeAnd {
    1.19 +    static const bool value = 
    1.20 +    _CompileTimeAnd<Left::value, Right::value>::value;
    1.21 +  };
    1.22 +
    1.23    template <typename T>
    1.24    struct Wrap {
    1.25      const T &value;