A static loop using TMP. More...
#include <dune/common/forloop.hh>
Static Public Member Functions | |
static void | apply () |
template<class T1 > | |
static void | apply (T1 &p1) |
template<class T1 , class T2 > | |
static void | apply (T1 &p1, T2 &p2) |
template<class T1 , class T2 , class T3 > | |
static void | apply (T1 &p1, T2 &p2, T3 &p3) |
template<class T1 , class T2 , class T3 , class T4 > | |
static void | apply (T1 &p1, T2 &p2, T3 &p3, T4 &p4) |
template<class T1 , class T2 , class T3 , class T4 , class T5 > | |
static void | apply (T1 &p1, T2 &p2, T3 &p3, T4 &p4, T5 &p5) |
A static loop using TMP.
The ForLoop takes a
template<int i> class Operation
template argument with a static apply method which is called for i=first...last (first<=last are int template arguments). A specialization for class template class Operation for i=first or i=last is not required. The class Operation must provide a static void function apply(...). Arguments (as references) can be passed through the ForLoop to this function (up to 5 at the moment).
It is possible to pass a subclass to the ForLoop (since no specialization is needed). Example of usage:
template <class Foo> struct A { template <int i> struct Operation { template <class T> static void apply(const double &x,const T &t, T &ret) { ret = "hallo" + t; } }; void useForLoop() { std::string world; ForLoop<Operation,1,10>::apply(1.,"hallo",world); } };
static void Dune::ForLoop< Operation, first, last >::apply | ( | T1 & | p1, | |
T2 & | p2, | |||
T3 & | p3, | |||
T4 & | p4, | |||
T5 & | p5 | |||
) | [inline, static] |
References Dune::ForLoop< Operation, first, last >::apply().
static void Dune::ForLoop< Operation, first, last >::apply | ( | T1 & | p1, | |
T2 & | p2, | |||
T3 & | p3, | |||
T4 & | p4 | |||
) | [inline, static] |
References Dune::ForLoop< Operation, first, last >::apply().
static void Dune::ForLoop< Operation, first, last >::apply | ( | T1 & | p1, | |
T2 & | p2, | |||
T3 & | p3 | |||
) | [inline, static] |
References Dune::ForLoop< Operation, first, last >::apply().
static void Dune::ForLoop< Operation, first, last >::apply | ( | T1 & | p1, | |
T2 & | p2 | |||
) | [inline, static] |
References Dune::ForLoop< Operation, first, last >::apply().
static void Dune::ForLoop< Operation, first, last >::apply | ( | T1 & | p1 | ) | [inline, static] |
References Dune::ForLoop< Operation, first, last >::apply().
static void Dune::ForLoop< Operation, first, last >::apply | ( | ) | [inline, static] |