CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Composition.h
Go to the documentation of this file.
1 #ifndef PhysicsTools_Utilities_Composition_h
2 #define PhysicsTools_Utilities_Composition_h
3 
4 namespace funct {
5  template <typename A, typename B>
7  CompositionStruct(const A& a, const B& b) : _1(a), _2(b) {}
8  double operator()() const { return _1(_2()); }
9  operator double() const { return _1(_2()); }
10  double operator()(double x) const { return _1(_2(x)); }
11  double operator()(double x, double y) const { return _1(_2(x, y)); }
12  A _1;
13  B _2;
14  };
15 
16  template <typename A, typename B>
17  struct Composition {
19  static type compose(const A& a, const B& b) { return type(a, b); }
20  };
21 
22  template <typename A, typename B>
23  inline typename funct::Composition<A, B>::type compose(const A& a, const B& b) {
25  }
26 
27 } // namespace funct
28 
29 #endif
static type compose(const A &a, const B &b)
Definition: Composition.h:19
double operator()(double x) const
Definition: Composition.h:10
double operator()(double x, double y) const
Definition: Composition.h:11
CompositionStruct(const A &a, const B &b)
Definition: Composition.h:7
funct::Composition< A, B >::type compose(const A &a, const B &b)
Definition: Composition.h:23
CompositionStruct< A, B > type
Definition: Composition.h:18
double b
Definition: hdecay.h:118
double a
Definition: hdecay.h:119
double operator()() const
Definition: Composition.h:8