MetaUtils Namespace Reference
Detailed DescriptionTypedef Documentation◆ detected_or
template<class Default , template< class... > class Op, class... Args>
Definition at line 97 of file MetaUtils.h. ◆ detected_t
template<template< class... > class Op, class... Args>
Definition at line 94 of file MetaUtils.h. ◆ is_detected
template<template< class... > class Op, class... Args>
Definition at line 91 of file MetaUtils.h. ◆ is_detected_exact
template<class Expected , template< class... > class Op, class... Args>
Definition at line 100 of file MetaUtils.h. ◆ is_instance
template<typename T , template< typename ... > class U>
Detects if type T is an instance of template U. Definition at line 88 of file MetaUtils.h. Function Documentation◆ check()
Definition at line 114 of file MetaUtils.h. 114 {
115 if (pred == false)
116 std::clog << funcName << " FAILED\n";
117 return (int)(pred ? EXIT_SUCCESS : EXIT_FAILURE);
118 }
◆ checkConcept()
template<typename T , template< class U > class Concept>
checks whether if T satisfies user defined Concept
Definition at line 110 of file MetaUtils.h. 110 {
111 return Concept<T>::checkResult::value;
112 }
◆ removeTupleElement()
template<size_t I, typename... Ts>
Definition at line 147 of file MetaUtils.h. 147 {
148 return _removeTupleElement<I>(tup, std::make_index_sequence<sizeof...(Ts)>{});
149 }
◆ staticFor()
template<size_t N, class Func >
Used to apply functor on tuple. Calls lambda with integral constant, which can be used to query tuple elements via std::get<I>(), and thus iterate over tuple. To use, create lambda which captures every necessary variable by referenrece (or value) and has (auto I) parameter. Then use I inside lambda to call templated functions. Definition at line 34 of file MetaUtils.h. 34 {
35 staticForImpl(std::forward<Func>(f),
36 std::make_index_sequence<N>{});
37 }
constexpr void staticForImpl(Func &&f, std::index_sequence< Is... >) Definition MetaUtils.h:13 References staticForImpl(). Referenced by YODA::containsNan(). ◆ staticForImpl()
template<class Func , std::size_t... Is>
Definition at line 13 of file MetaUtils.h. 14 {
15 // Use C++17 fold expressions to apply Func f
16 // to all Is... in sequence
17 //
18 // Won't work on empty tuple (Binning is not intended to work with 0 dimensions).
19 //
20 // std::integral_constant used to encode value into type, otherwise it's not
21 // possible to use Is inside functor as consant expression
22 // (std::get<Is> etc. won't work)
23
24 ((void)f(std::integral_constant<std::size_t, Is>()), ...);
25 }
Referenced by staticFor(). Variable Documentation◆ is_detected_v
template<template< class... > class Op, class... Args>
Definition at line 103 of file MetaUtils.h. Generated on Mon Oct 28 2024 13:47:24 for YODA - Yet more Objects for Data Analysis by 1.9.8 |