CMS 3D CMS Logo

Composition.h
Go to the documentation of this file.
1 #ifndef PhysicsTools_Utilities_Composition_h
2 #define PhysicsTools_Utilities_Composition_h
3 #include <boost/static_assert.hpp>
4 
5 namespace funct {
6  template<typename A, typename B>
7  struct CompositionStruct {
8  CompositionStruct(const A & a, const B & b) : _1(a), _2(b) { }
9  double operator()() const {
10  return _1(_2());
11  }
12  operator double() const {
13  return _1(_2());
14  }
15  double operator()(double x) const {
16  return _1(_2(x));
17  }
18  double operator()(double x, double y) const {
19  return _1(_2(x, y));
20  }
21  A _1;
22  B _2;
23  };
24 
25  template<typename A, typename B>
26  struct Composition {
28  static type compose(const A& a, const B& b) { return type(a, b); }
29  };
30 
31  template<typename A, typename B>
32  inline typename funct::Composition<A, B>::type compose(const A& a, const B& b) {
34  }
35 
36 }
37 
38 
39 #endif
Definition: Abs.h:5
static type compose(const A &a, const B &b)
Definition: Composition.h:28
double operator()(double x) const
Definition: Composition.h:15
double operator()(double x, double y) const
Definition: Composition.h:18
CompositionStruct(const A &a, const B &b)
Definition: Composition.h:8
funct::Composition< A, B >::type compose(const A &a, const B &b)
Definition: Composition.h:32
CompositionStruct< A, B > type
Definition: Composition.h:27
double b
Definition: hdecay.h:120
arg type
Definition: Factorize.h:38
double a
Definition: hdecay.h:121
double operator()() const
Definition: Composition.h:9