Dune Core Modules (2.4.1)
helper class to implement transformTuple() More...
#include <dune/common/tupleutility.hh>
Classes | |
struct | TypeEvaluator |
export the TypeEvaluator template class for genericTransformTuple() More... | |
Public Member Functions | |
TransformTupleFunctor (A0 &a0_, A1 &a1_, A2 &a2_, A3 &a3_, A4 &a4_, A5 &a5_, A6 &a6_, A7 &a7_, A8 &a8_, A9 &a9_) | |
constructor More... | |
template<class T > | |
TE< T >::Type | operator() (T &t) const |
call TE<T>::apply(t,args...) More... | |
Detailed Description
class Dune::TransformTupleFunctor< TE, A0, A1, A2, A3, A4, A5, A6, A7, A8, A9 >
helper class to implement transformTuple()
- Template Parameters
-
TE TypeEvaluator class template. An Type of extra arguments to pass to TE<T>::apply()
.void
means "no argument". Only trailing arguments may be void.
This class stores references to a number of arguments it receives in the constructor. Later, its function call operator operator()
may be called with a parameter t
of type T
. operator()
will then call the static method TE<T>::apply(t,args...)
, where args
... is the sequence of arguments the object was constructed with. operator()
will convert the result to type TE<T>::Type
and return it.
TE
should be an extended version of the TypeEvaluator
class template parameter of ForEachType, for instance:
This example is for a TransformTupleFunctor with one argument, i.e. A0!=void
and all other An=void
. For the type transformation, it will transform a value of some type T into a pointer to T. For the value transformation, it will take a reference to a value of type T and return the pointer to that value, unless the value evaluates to false in boolean context. If the value evaluates to false, it will instead return the pointer from the extra argument.
Constructor & Destructor Documentation
◆ TransformTupleFunctor()
|
inline |
constructor
The actual number of arguments varies between specializations, the actual number of arguments here is equal to the number of non-void
class template arguments An
.
Member Function Documentation
◆ operator()()
|
inline |
call TE<T>::apply(t,args...)
This calls the static apply method of the TypeEvaluator class template.
- Note
- There is no need to overload
operator()
with atconst
T&
argument, since genericTransformTuple() will always use an lvalue argument.
The documentation for this class was generated from the following file:
- dune/common/tupleutility.hh