DUNE-ACFEM (unstable)

closuretraits.hh
1#ifndef __DUNE_ACFEM_TENSORS_BINDINGS_DUNE_CLOSURETRAITS_HH__
2#define __DUNE_ACFEM_TENSORS_BINDINGS_DUNE_CLOSURETRAITS_HH__
3
4#include "../../../expressions/interface.hh"
5#include "../../tensorbase.hh"
6
7namespace Dune
8{
9 namespace ACFem
10 {
11 namespace Tensor
12 {
13 // Forward
14 template<class Tensor>
15 class TensorResult;
16
21 template<class T, std::enable_if_t<(IsTensor<T>::value && !Expressions::IsClosure<T>::value), int> = 0>
22 constexpr auto expressionClosure(T&& t)
23 {
24 //std::clog << "cls arg address: " << &t << std::endl;
25 return TensorResult<T>(std::forward<T>(t));
26 }
27
28 } // NS Tensor
29
30 namespace Expressions
31 {
32
34 template<class T>
35 struct IsClosure<Tensor::TensorResult<T> >
36 : TrueType
37 {};
38
39 } // NS Expressions
40
41 } // NS ACFem
42
43} // NS Dune
44
45#endif // __DUNE_ACFEM_TENSORS_BINDINGS_DUNE_CLOSURETRAITS_HH__
constexpr decltype(auto) expressionClosure(T &&t)
Do-nothing default implementation for pathologic cases.
Definition: interface.hh:93
BoolConstant< true > TrueType
Alias for std::true_type.
Definition: types.hh:107
An expression closure is a wrapper class which wraps an expression in order to interface to other exi...
Definition: interface.hh:50
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Jul 15, 22:36, 2024)