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>
34 struct yes {
char dummy[1]; };
35 struct no {
char dummy[2]; };
38 static yes test(
typename X::NodeTag *);
44 value =
sizeof(test<T>(0)) ==
sizeof(
yes)
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);
64 value =
sizeof(test<T>(0)) ==
sizeof(
yes)
71 struct yes {
char dummy[1]; };
72 struct no {
char dummy[2]; };
75 static yes test(
typename X::ImplementationTag *);
81 value =
sizeof(test<T>(0)) ==
sizeof(
yes)
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);
101 value =
sizeof(test<T>(0)) ==
sizeof(
yes)
151 typedef typename conditional<
152 is_base_of<meta_function,F>::value,
166 return std::false_type();
173 return std::true_type();
177 template<std::size_t... i>
181 return std::true_type();
189 return std::true_type();
206 public decltype(impl::isTreePath((typename std::decay<T>::type*)(nullptr)))
226 #endif // DUNE_TYPETREE_TYPETRAITS_HH constexpr auto isTreePath(const T &) -> IsTreePath< T >
Check if given object represents a tree path.
Definition: typetraits.hh:216
Meta function that evaluates its argument iff it inherits from meta_function.
Definition: typetraits.hh:149
Definition: typetraits.hh:86
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:35
F type
Definition: typetraits.hh:144
Definition: typetraits.hh:90
Definition: typetraits.hh:91
Definition: typetraits.hh:69
T0 type
Definition: typetraits.hh:26
A TreePath that stores the path of a node as runtime information.
Definition: treepath.hh:157
Definition: typetraits.hh:89
Definition: typetraits.hh:49
Definition: typetraits.hh:21
Definition: typetraits.hh:53
Definition: treepath.hh:30
Definition: typetraits.hh:71
F::type type
Definition: typetraits.hh:137
Definition: typetraits.hh:72
Identity function.
Definition: typetraits.hh:142
Check if type represents a tree path.
Definition: typetraits.hh:205
Definition: typetraits.hh:32
T * declptr()
Helper function for generating a pointer to a value of type T in an unevaluated operand setting...
void type
Definition: typetraits.hh:108
Definition: typetraits.hh:106
conditional< is_base_of< meta_function, F >::value, lazy_evaluate< F >, lazy_identity< F > >::type::type type
Definition: typetraits.hh:155
Definition: typetraits.hh:34
Marker tag declaring a meta function.
Definition: typetraits.hh:131
Definition: typetraits.hh:54
Definition: accumulate_static.hh:12
Helper meta function to delay evaluation of F.
Definition: typetraits.hh:135