test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 {
11  return - _();
12  }
13  double operator()() const {
14  return - _();
15  }
16  double operator()(double x) const {
17  return - _(x);
18  }
19  double operator()(double x, double y) const {
20  return - _(x, y);
21  }
22  A _;
23  };
24 
25  template<typename A>
26  struct Minus {
28  static type operate(const A& a) {
29  return type(a);
30  }
31  };
32 
33  template<typename A>
34  inline typename Minus<A>::type operator-(const A& a) {
35  return Minus<A>::operate(a);
36  }
37 }
38 
39 #endif
Difference< A, B >::type operator-(const A &a, const B &b)
Definition: Difference.h:15
double operator()() const
Definition: Minus.h:13
MinusStruct< A > type
Definition: Minus.h:27
double operator()(double x) const
Definition: Minus.h:16
double a
Definition: hdecay.h:121
double operator()(double x, double y) const
Definition: Minus.h:19
MinusStruct(const A &a)
Definition: Minus.h:9
static type operate(const A &a)
Definition: Minus.h:28