DUNE PDELab (2.7)

typetraits.hh
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2// vi: set et ts=4 sw=2 sts=2:
3
4#ifndef DUNE_PDELAB_COMMON_TYPETRAITS_HH
5#define DUNE_PDELAB_COMMON_TYPETRAITS_HH
6
8#include <dune/typetree/typetraits.hh>
9
10namespace Dune {
11 namespace PDELab {
12
13 // Import AlwaysVoid from TypeTree library
14 using TypeTree::AlwaysVoid;
15
16 // forward decl of Tag defined in function.hh
17 struct GridFunctionTag;
18 struct PowerGridFunctionTag;
19 struct CompositeGridFunctionTag;
20
21#ifndef DOXYGEN
22
23 namespace impl {
24
25 template<typename T, typename = void>
26 struct IsGridFunction
27 {
28 static const bool value = false;
29 };
30
31 template<typename T>
32 struct IsGridFunction<T, typename AlwaysVoid<TypeTree::ImplementationTag<T>>::type >
33 {
34 using A = TypeTree::ImplementationTag<T>;
35 static const bool value = std::is_same<A, GridFunctionTag>::value ||
36 std::is_same<A, PowerGridFunctionTag>::value ||
37 std::is_same<A, CompositeGridFunctionTag>::value;
38 };
39
40 } // namespace impl
41
42#endif // DOXYGEN
43
44 template<typename T>
45 using IsGridFunction = std::integral_constant<bool,impl::IsGridFunction<std::decay_t<T>>::value>;
46
47 } // end namespace PDELab
48} // end namespace Dune
49
50#endif // DUNE_PDELAB_COMMON_TYPETRAITS_HH
Traits for type conversions and type information.
typename std::decay_t< T >::ImplementationTag ImplementationTag
Returns the implementation tag of the given Node.
Definition: nodeinterface.hh:66
Dune namespace.
Definition: alignedallocator.hh:14
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Jul 15, 22:36, 2024)