4#ifndef DUNE_TYPETREE_TYPETRAITS_HH
5#define DUNE_TYPETREE_TYPETRAITS_HH
10#include <dune/typetree/treepath.hh>
11#include <dune/typetree/nodeinterface.hh>
18 template<
typename... T>
21 template<
typename T0,
typename... T>
22 struct first_type<T0,T...>
32 struct yes {
char dummy[1]; };
33 struct no {
char dummy[2]; };
36 static yes test(NodeTag<X> *);
42 value =
sizeof(test<T>(0)) ==
sizeof(yes)
46 template<
typename T,
typename V>
47 struct has_node_tag_value
50 struct maybe {
char dummy[N+1]; };
51 struct yes {
char dummy[2]; };
52 struct no {
char dummy[1]; };
55 static maybe<std::is_base_of<V, NodeTag<X>>::value>
62 value =
sizeof(test<T>(0)) ==
sizeof(yes)
67 struct has_implementation_tag
69 struct yes {
char dummy[1]; };
70 struct no {
char dummy[2]; };
73 static yes test(ImplementationTag<X> *);
79 value =
sizeof(test<T>(0)) ==
sizeof(yes)
83 template<
typename T,
typename V>
84 struct has_implementation_tag_value
87 struct maybe {
char dummy[N+1]; };
88 struct yes {
char dummy[2]; };
89 struct no {
char dummy[1]; };
92 static maybe<std::is_base_of<V, ImplementationTag<X>>::value>
93 test(ImplementationTag<X> * a);
99 value =
sizeof(test<T>(0)) ==
sizeof(yes)
135 typedef typename F::type type;
149 typedef typename std::conditional<
150 std::is_base_of<meta_function,F>::value,
161 constexpr auto isTreePath(
void*)
164 return std::false_type();
169 constexpr auto isTreePath(
const HybridTreePath<I...>*)
172 return std::true_type();
189 public decltype(impl::isTreePath((typename std::decay<T>::type*)(nullptr)))
199 constexpr auto isTreePath(
const T&)
Traits for type conversions and type information.
Dune namespace.
Definition: alignedallocator.hh:11
Check if type represents a tree path.
Definition: typetraits.hh:190
Helper meta function to delay evaluation of F.
Definition: typetraits.hh:134
Identity function.
Definition: typetraits.hh:141