Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:29:15

0001 #ifndef FWCore_SOA_tablehelpers_h
0002 #define FWCore_SOA_tablehelpers_h
0003 // -*- C++ -*-
0004 //
0005 // Package:     FWCore/SOA
0006 //
0007 /**
0008 
0009  Description: classes and functions used by edm::soa::Table
0010 
0011  Usage:
0012     These are internal details of Table's implementation
0013 
0014 */
0015 //
0016 // Original Author:  Chris Jones
0017 //         Created:  Thu, 24 Aug 2017 16:18:18 GMT
0018 //
0019 
0020 // system include files
0021 #include <type_traits>
0022 #include <tuple>
0023 
0024 // user include files
0025 
0026 // forward declarations
0027 
0028 namespace edm {
0029   namespace soa {
0030     namespace impl {
0031 
0032       template <int I>
0033       struct FoundIndex {
0034         static constexpr int index = I;
0035       };
0036 
0037       template <int I, typename T, typename TPL>
0038       struct GetIndex {
0039         static constexpr int index = std::conditional<std::is_same<T, typename std::tuple_element<I, TPL>::type>::value,
0040                                                       FoundIndex<I>,
0041                                                       GetIndex<I + 1, T, TPL>>::type::index;
0042       };
0043 
0044     }  // namespace impl
0045   }    // namespace soa
0046 }  // namespace edm
0047 
0048 #endif