9 #ifndef LARCOREALG_COREUTILS_CONTAINERMETA_H
10 #define LARCOREALG_COREUTILS_CONTAINERMETA_H
20 #include <type_traits>
60 template <
typename Coll>
64 template <
typename Coll>
70 template <
typename Coll>
74 template <
typename Coll>
81 template <
typename Coll>
85 template <
typename Coll>
105 template <
typename Coll>
109 template <
typename Coll>
127 template <
typename Coll>
143 template <
typename Cont>
147 template <
typename Cont>
165 template <
typename CollRef>
185 template <
typename Ptr>
188 template <
typename T>
194 template <
typename T>
200 template <
typename T, std::
size_t N>
207 template <
typename Ptr,
typename =
void>
213 template <
typename Coll,
typename =
void>
215 using type =
typename Coll::value_type;
219 template <
typename Coll>
225 template <
typename Coll>
227 <Coll,
std::
enable_if_t<util::is_unique_ptr_v<std::decay_t<Coll>>>>
233 template <
typename Coll,
typename =
void>
245 template <
typename T>
247 using type = decltype(*(std::declval<T*>()));
252 template <
typename Ptr>
256 <std::remove_reference_t<typename Ptr::pointer>>
261 template <
typename Coll,
typename =
void>
273 template <
typename T>
275 using type = decltype(*(std::declval<std::add_const_t<T>*>()));
279 template <
typename Ptr>
283 <std::remove_reference_t<typename Ptr::pointer>>
290 template <
typename Coll,
typename =
void>
292 using type = std::reference_wrapper<Coll>;
293 static auto make(Coll& coll) {
return std::ref(coll); }
296 template <
typename Coll>
300 using type = std::remove_cv_t<Coll>;
304 template <
typename Coll>
308 using type =
typename Coll::pointer;
309 static type make(Coll& uptr) {
return uptr.get(); }
312 template <
typename Ptr>
318 std::remove_all_extents_t<
319 std::remove_pointer_t<std::decay_t<Ptr>>
329 template <
typename CollRef,
typename =
void>
332 = std::add_lvalue_reference_t<std::remove_reference_t<CollRef>>;
333 static CollRef&
get(CollRef& coll) {
return coll; }
336 template <
typename CollRef>
338 <CollRef,
std::
enable_if_t<util::is_reference_wrapper_v<CollRef>>>
340 using type = std::add_lvalue_reference_t<typename CollRef::type>;
341 static type get(CollRef& refw) {
return refw.get(); }
344 template <
typename CollRef>
348 using type =
typename CollRef::pointer;
349 static type get(CollRef& uptr) {
return uptr.get(); }
352 template <
typename T>
355 static type get(T* ptr) {
return ptr; }
358 template <
typename T>
361 static type get(T ptr[]) {
return ptr; }
364 template <
typename T, std::
size_t N>
367 static type get(T ptr[
N]) {
return ptr; }
377 template <
typename Coll>
378 struct collection_value_type {
382 typename details::collection_value_type_impl
390 template <
typename Coll>
393 <util::strip_referenceness_t<Coll>>
398 template <
typename Coll>
399 struct collection_value_constant_access_type
400 :
public details::collection_value_constant_access_type_impl
401 <util::strip_referenceness_t<Coll>>
406 template <
typename Coll>
407 struct collection_reference_type
408 : details::make_collection_reference_impl<std::remove_reference_t<Coll>>
412 template <
typename Coll>
420 template <
typename CollRef>
421 struct collection_from_reference_type
422 : details::collection_from_reference_impl<std::remove_reference_t<CollRef>>
426 template <
typename CollRef>
437 #endif // LARCOREALG_COREUTILS_CONTAINERMETA_H
static CollRef & get(CollRef &coll)
double std(const std::vector< short > &wf, const double ped_mean, size_t start, size_t nsample)
util::strip_referenceness_t< typename details::collection_value_type_impl< util::strip_referenceness_t< Coll >>::type > type
collection_value_t< std::remove_reference_t< Ptr::pointer > > value_type
Trait of type obtained by constant access to element of collection Coll.
std::add_lvalue_reference_t< std::remove_reference_t< std::remove_reference_t< CollRef > >> type
auto cbegin(FixedBins< T, C > const &) noexcept
static auto getCBegin(Coll &&coll)
static type make(Ptr &ptr)
Trait with the type of collection referenced by collRef.
Trait of type obtained by access to element of collection Coll.
collection_value_t< std::remove_reference_t< Ptr::pointer > > value_type
Trait of a type that can be used to reference the collection Coll.
std::add_const_t< T > value_type
typename std::enable_if< B, T >::type enable_if_t
decltype(*getBegin(std::declval< util::strip_referenceness_t< Coll > >())) type
std::reference_wrapper< std::remove_reference_t< Coll > > type
static type make(Coll &refw)
auto begin(FixedBins< T, C > const &) noexcept
typename Coll::value_type type
decltype(*getCBegin(std::declval< util::strip_referenceness_t< Coll > >())) type
static auto getBegin(Coll &&coll)
process_name largeant stream1 can override from command line with o or output physics producers generator N
static type make(Coll &uptr)
decltype(auto) constexpr cbegin(T &&obj)
ADL-aware version of std::cbegin.
decltype(auto) constexpr begin(T &&obj)
ADL-aware version of std::begin.
Trait of value contained in the template collection Coll.
static auto make(Coll &coll)