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> *);
41 constexpr static bool value =
sizeof(test<T>(0)) ==
sizeof(yes);
44 template<
typename T,
typename V>
45 struct has_node_tag_value
48 struct maybe {
char dummy[N+1]; };
49 struct yes {
char dummy[2]; };
50 struct no {
char dummy[1]; };
53 static maybe<std::is_base_of<V, NodeTag<X>>::value>
59 constexpr static bool value =
sizeof(test<T>(0)) ==
sizeof(yes);
63 struct has_implementation_tag
65 struct yes {
char dummy[1]; };
66 struct no {
char dummy[2]; };
69 static yes test(ImplementationTag<X> *);
74 constexpr static bool value =
sizeof(test<T>(0)) ==
sizeof(yes);
77 template<
typename T,
typename V>
78 struct has_implementation_tag_value
81 struct maybe {
char dummy[N+1]; };
82 struct yes {
char dummy[2]; };
83 struct no {
char dummy[1]; };
86 static maybe<std::is_base_of<V, ImplementationTag<X>>::value>
87 test(ImplementationTag<X> * a);
92 constexpr static bool value =
sizeof(test<T>(0)) ==
sizeof(yes);
127 typedef typename F::type type;
141 typedef typename std::conditional<
142 std::is_base_of<meta_function,F>::value,
153 constexpr auto isTreePath(
void*)
156 return std::false_type();
161 constexpr auto isTreePath(
const HybridTreePath<I...>*)
164 return std::true_type();
181 public decltype(impl::isTreePath((typename std::decay<T>::type*)(nullptr)))
191 constexpr auto isTreePath(
const T&)
Traits for type conversions and type information.
Dune namespace.
Definition: alignedallocator.hh:13
Check if type represents a tree path.
Definition: typetraits.hh:182
Helper meta function to delay evaluation of F.
Definition: typetraits.hh:126
Identity function.
Definition: typetraits.hh:133