Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 11:16:52

0001 #ifndef PhysicsTools_Utilities_DecomposeProduct_h
0002 #define PhysicsTools_Utilities_DecomposeProduct_h
0003 #include "PhysicsTools/Utilities/interface/Product.h"
0004 
0005 namespace funct {
0006 
0007   template <typename A, typename B>
0008   struct DecomposeProduct {};
0009 
0010   template <typename A>
0011   struct DecomposeProduct<A, A> {
0012     inline static const A& get(const A& a) { return a; }
0013   };
0014 
0015   template <typename A, typename B>
0016   struct DecomposeProduct<ProductStruct<A, B>, A> {
0017     inline static const A& get(const ProductStruct<A, B>& _) { return _._1; }
0018   };
0019 
0020   template <typename A, typename B>
0021   struct DecomposeProduct<ProductStruct<A, B>, B> {
0022     inline static const B& get(const ProductStruct<A, B>& _) { return _._2; }
0023   };
0024 
0025 }  // namespace funct
0026 
0027 #endif