1 #ifndef Framework_produce_helpers_h 2 #define Framework_produce_helpers_h 32 template <
typename FromT,
typename ToT>
42 (not std::is_pointer_v<T>),
43 "use std::shared_ptr or std::unique_ptr to hold EventSetup data products, do not use bare pointers");
80 using type =
typename T::element_type;
81 static auto getPointer(
T const& iPtr) -> decltype(&*iPtr) {
return &*iPtr; }
87 static auto getPointer(std::unique_ptr<const T>
const& iPtr) -> decltype(&*iPtr) {
return &*iPtr; }
93 static auto getPointer(std::shared_ptr<const T>
const& iPtr) -> decltype(&*iPtr) {
return &*iPtr; }
100 if (iPtr.has_value()) {
107 template <
typename T,
typename FindT>
110 template <
typename HeadT,
typename TailT>
112 if constexpr (not std::is_same_v<TailT, FindT>) {
114 return findIndexOf<typename container_type::head_type, typename container_type::tail_type>() + 1;
120 findIndexOf<typename container_type::head_type, typename container_type::tail_type>();
123 template <
typename T>
124 const char*
name(
const T*);
typename product_traits< T >::type container_type
typename T::element_type type
const char * name(const T *)
static T const * getPointer(std::optional< T > const &iPtr)
static auto getPointer(T const &iPtr) -> decltype(&*iPtr)
std::unique_ptr< T, impl::DeviceDeleter > unique_ptr
void moveFromTo(FromT &iFrom, ToT &iTo)
static auto getPointer(std::unique_ptr< const T > const &iPtr) -> decltype(&*iPtr)
static constexpr int findIndexOf()
static auto getPointer(std::shared_ptr< const T > const &iPtr) -> decltype(&*iPtr)
typename product_traits< T >::type type