File indexing completed on 2023-03-17 11:16:52
0001 #ifndef PhysicsTools_Utilities_Difference_h
0002 #define PhysicsTools_Utilities_Difference_h
0003 #include "PhysicsTools/Utilities/interface/Sum.h"
0004 #include "PhysicsTools/Utilities/interface/Minus.h"
0005
0006 namespace funct {
0007
0008 template <typename A, typename B>
0009 struct Difference {
0010 typedef typename Sum<A, typename Minus<B>::type>::type type;
0011 inline static type combine(const A& a, const B& b) { return a + (-b); }
0012 };
0013
0014 template <typename A, typename B>
0015 inline typename Difference<A, B>::type operator-(const A& a, const B& b) {
0016 return Difference<A, B>::combine(a, b);
0017 }
0018
0019 }
0020
0021 #endif