8 #ifndef LARDATA_UTILITIES_DEREFERENCE_H 9 #define LARDATA_UTILITIES_DEREFERENCE_H 1 12 #include <type_traits> 23 struct is_type :
public std::true_type {};
48 template <
typename T,
typename Enable =
void>
54 typename
std::enable_if<is_type<decltype(*(T()))>::value, void>
::type>
55 :
public std::true_type {};
94 template <
typename T,
bool CanDereference>
100 template <
typename T>
124 template <
typename T,
bool CanDereference>
133 template <
typename T>
137 typename std::add_lvalue_reference<typename dereferenced_type<T, true>::type>
::type;
161 template <
typename T,
bool CanDereference>
165 typename std::add_pointer<typename dereferenced_type<T, CanDereference>::type>
::type;
170 template <
typename T>
174 typename std::add_pointer<typename dereferenced_type<T, true>::type>
::type;
204 template <
typename T>
237 template <
typename T>
275 template <
typename T>
288 #endif // LARDATA_UTILITIES_DEREFERENCE_H Functor returning the dereferenced value of the argument.
Namespace for general, non-LArSoft-specific utilities.
details::make_pointer_class< T, details::has_dereference_class< T >::value >::pointer_type make_pointer(T &v)
Returns a pointer to the value of argument, or the argument itself.
reference_type operator()(argument_type &ref) const
typename std::add_lvalue_reference< typename dereferenced_type< T, CanDereference >::type >::type reference_type
pointer_type operator()(argument_type &ref) const
Functor returning the pointer to a value in the argument.
details::dereference_class< T, details::has_dereference_class< T >::value >::reference_type dereference(T &v)
Returns the value pointed by the argument, or the argument itself.
pointer_type operator()(argument_type &ref) const
typename std::add_pointer< typename dereferenced_type< T, CanDereference >::type >::type pointer_type
Class defining the dereferenced type of the specified type.
LArSoft-specific namespace.
Class holding the type dereferenced from an object of type T.
reference_type operator()(argument_type &ref) const
Class compiling only if type T exists (then, it's std::true_type)
Class defining whether the specified type can be dereferenced.
typename std::add_lvalue_reference< typename dereferenced_type< T, true >::type >::type reference_type
typename std::add_pointer< typename dereferenced_type< T, true >::type >::type pointer_type