4 #ifndef DUNE_TYPETREE_TYPETRAITS_HH
5 #define DUNE_TYPETREE_TYPETRAITS_HH
8 #include <dune/common/typetraits.hh>
18 using std::is_base_of;
20 template<
typename... T>
23 template<
typename T0,
typename... T>
38 static yes test(
typename X::NodeTag *);
48 template<
typename T,
typename V>
52 struct maybe {
char dummy[N+1]; };
53 struct yes {
char dummy[2]; };
54 struct no {
char dummy[1]; };
58 test(
typename X::NodeTag * a);
71 struct yes {
char dummy[1]; };
72 struct no {
char dummy[2]; };
75 static yes test(
typename X::ImplementationTag *);
85 template<
typename T,
typename V>
89 struct maybe {
char dummy[N+1]; };
90 struct yes {
char dummy[2]; };
91 struct no {
char dummy[1]; };
95 test(
typename X::ImplementationTag * a);
115 #if HAVE_STD_DECLTYPE
116 #define DUNE_DECLTYPE decltype
117 #elif HAVE_GCC___TYPEOF__
118 #define DUNE_DECLTYPE __typeof__
120 #error The TypeTree library requires support for
121 #error C++11 decltype or a compatible fallback in your compiler.
122 #error Neither of those was found, aborting!!!!
167 typedef typename conditional<
168 is_base_of<meta_function,F>::value,
182 return std::false_type();
189 return std::true_type();
193 template<std::size_t... i>
197 return std::true_type();
205 return std::true_type();
222 public decltype(impl::isTreePath((typename std::decay<T>::type*)(nullptr)))
242 #endif // DUNE_TYPETREE_TYPETRAITS_HH
Definition: typetraits.hh:32
Definition: typetraits.hh:69
True if class T defines a NodeTag.
Definition: typetraits.hh:44
T * declptr()
Helper function for generating a pointer to a value of type T in an unevaluated operand setting...
Marker tag declaring a meta function.
Definition: typetraits.hh:147
Definition: typetraits.hh:54
Definition: accumulate_static.hh:12
char dummy[1]
Definition: typetraits.hh:34
Definition: typetraits.hh:86
F::type type
Definition: typetraits.hh:153
T0 type
Definition: typetraits.hh:26
Definition: typetraits.hh:35
F type
Definition: typetraits.hh:160
Meta function that evaluates its argument iff it inherits from meta_function.
Definition: typetraits.hh:165
constexpr auto isTreePath(const T &) -> IsTreePath< T >
Check if given object represents a tree path.
Definition: typetraits.hh:232
static yes test(typename X::NodeTag *)
Definition: typetraits.hh:52
A hybrid version of TreePath that supports both compile time and run time indices.
Definition: treepath.hh:322
Definition: typetraits.hh:71
Definition: typetraits.hh:34
Definition: typetraits.hh:91
A TreePath that stores the path of a node as runtime information.
Definition: treepath.hh:157
Helper meta function to delay evaluation of F.
Definition: typetraits.hh:151
Definition: typetraits.hh:89
Definition: typetraits.hh:49
Definition: typetraits.hh:21
Definition: typetraits.hh:90
Definition: typetraits.hh:53
void type
Definition: typetraits.hh:108
conditional< is_base_of< meta_function, F >::value, lazy_evaluate< F >, lazy_identity< F > >::type::type type
Definition: typetraits.hh:171
Definition: typetraits.hh:72
Identity function.
Definition: typetraits.hh:158
Check if type represents a tree path.
Definition: typetraits.hh:221
Definition: treepath.hh:30
Definition: typetraits.hh:106
char dummy[2]
Definition: typetraits.hh:35