CMS 3D CMS Logo

ParametricTrait.h
Go to the documentation of this file.
1 #ifndef PhysicsTools_Utilities_ParametricTrait_h
2 #define PhysicsTools_Utilities_ParametricTrait_h
3 
7 
8 namespace funct {
9 
10  template <typename F>
11  struct Parametric {
12  static const int value = 1;
13  };
14 
15  template <int n>
16  struct Parametric<Numerical<n> > {
17  static const int value = 0;
18  };
19 
20  template <int n, int m>
22  static const int value = 0;
23  };
24 
25 #define NON_PARAMETRIC(FUN) \
26  template <> \
27  struct Parametric<FUN> { \
28  static const int value = 0; \
29  }
30 
31 #define NON_PARAMETRIC_UNARY(FUN) \
32  template <typename A> \
33  struct Parametric<FUN<A> > { \
34  static const int value = Parametric<A>::value; \
35  }
36 
45 
46 #define NON_PARAMETRIC_BINARY(FUN) \
47  template <typename A, typename B> \
48  struct Parametric<FUN<A, B> > { \
49  static const int value = Parametric<A>::value || Parametric<A>::value; \
50  }
51 
56 
57 #undef NON_PARAMETRIC_UNARY
58 #undef NON_PARAMETRIC_BINARY
59 
60 } // namespace funct
61 
62 #endif
Definition: Abs.h:5
#define NON_PARAMETRIC_BINARY(FUN)
Definition: value.py:1
#define NON_PARAMETRIC_UNARY(FUN)