CMS 3D CMS Logo

Minus.h
Go to the documentation of this file.
1 #ifndef PhysicsTools_Utilities_Minus_h
2 #define PhysicsTools_Utilities_Minus_h
3 
4 namespace funct {
5 
6  template <typename A>
7  struct MinusStruct {
8  MinusStruct() : _() {}
9  MinusStruct(const A& a) : _(a) {}
10  operator double() const { return -_(); }
11  double operator()() const { return -_(); }
12  double operator()(double x) const { return -_(x); }
13  double operator()(double x, double y) const { return -_(x, y); }
14  A _;
15  };
16 
17  template <typename A>
18  struct Minus {
20  static type operate(const A& a) { return type(a); }
21  };
22 
23  template <typename A>
24  inline typename Minus<A>::type operator-(const A& a) {
25  return Minus<A>::operate(a);
26  }
27 } // namespace funct
28 
29 #endif
Difference< A, B >::type operator-(const A &a, const B &b)
Definition: Difference.h:15
Definition: Abs.h:5
double operator()(double x, double y) const
Definition: Minus.h:13
MinusStruct< A > type
Definition: Minus.h:19
double operator()() const
Definition: Minus.h:11
double a
Definition: hdecay.h:121
float x
MinusStruct(const A &a)
Definition: Minus.h:9
static type operate(const A &a)
Definition: Minus.h:20
double operator()(double x) const
Definition: Minus.h:12