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>
21  struct Parametric<FractionStruct<n, m> > {
22  static const int value = 0;
23  };
24 
25 #define NON_PARAMETRIC( FUN ) \
26 template<> struct Parametric<FUN> { \
27  static const int value = 0; \
28 }
29 
30 #define NON_PARAMETRIC_UNARY(FUN) \
31 template<typename A> \
32 struct Parametric<FUN<A> > { \
33  static const int value = Parametric<A>::value; \
34 }
35 
44 
45 #define NON_PARAMETRIC_BINARY(FUN) \
46 template<typename A, typename B> \
47 struct Parametric<FUN<A, B> > { \
48  static const int value = Parametric<A>::value || Parametric<A>::value; \
49 }
50 
55 
56 #undef NON_PARAMETRIC_UNARY
57 #undef NON_PARAMETRIC_BINARY
58 
59 }
60 
61 
62 #endif
Definition: Abs.h:5
#define NON_PARAMETRIC_BINARY(FUN)
Definition: value.py:1
#define NON_PARAMETRIC_UNARY(FUN)