Dune Core Modules (unstable)

Dune::TransformTupleFunctor< TE, Args > Class Template Reference

#include <dune/common/tupleutility.hh>

Detailed Description

template<template< class > class TE, class... Args>
class Dune::TransformTupleFunctor< TE, Args >
Template Parameters
TETypeEvaluator class template.
AnType 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:

template <class T>
struct TypeEvaluator
{
typedef T* Type;
static Type apply(T& t, void* a0)
{
return t ? &t : static_cast<T*>(a0);
}
};

In this example, for the value transformation, it takes 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.


The documentation for this class was generated from the following file:
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Dec 21, 23:30, 2024)