CMS 3D CMS Logo

mplVector.h
Go to the documentation of this file.
1 #ifndef FWCore_Utilities_mplVector_h
2 #define FWCore_Utilities_mplVector_h
3 // -*- C++ -*-
4 //
5 // Package: FWCore/Utilities
6 // Class : edm::mpl::Vector
7 //
37 //
38 // Original Author: Chris Jones
39 // Created: Tues, 21 Jul 2020 14:29:51 GMT
40 //
41 
42 // system include files
43 #include <type_traits>
44 
45 // user include files
46 
47 // forward declarations
48 
49 namespace edm {
50  namespace mpl {
51  template <typename... T>
52  class Vector {
53  public:
55  template <typename U>
56  static constexpr bool contains() {
57  return (std::is_same_v<U, T> || ...);
58  }
59  };
60 
61  template <typename T>
62  struct Pop;
63 
64  template <typename F, typename... T>
65  struct Pop<Vector<F, T...>> {
66  constexpr static bool empty = false;
67  using Item = F;
68  using Remaining = Vector<T...>;
69  };
70 
71  template <>
72  struct Pop<Vector<>> {
73  constexpr static bool empty = true;
74  using Item = void;
76  };
77  } // namespace mpl
78 } // namespace edm
79 
80 #endif
edm::mpl::Pop< Vector<> >::Item
void Item
Definition: mplVector.h:74
edm
HLT enums.
Definition: AlignableModifier.h:19
F
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
Definition: blowfish.cc:163
edm::mpl::Vector
Definition: mplVector.h:52
edm::mpl::Vector::contains
static constexpr bool contains()
Returns true if the type U is within the collection.
Definition: mplVector.h:56
T
long double T
Definition: Basic3DVectorLD.h:48
relativeConstraints.empty
bool empty
Definition: relativeConstraints.py:46
funct::void
TEMPL(T2) struct Divides void
Definition: Factorize.h:24
edm::mpl::Pop
Definition: mplVector.h:62
edm::mpl::Pop< Vector< F, T... > >::Item
F Item
Definition: mplVector.h:67