4#ifndef DUNE_COMMON_FORLOOP_HH
5#define DUNE_COMMON_FORLOOP_HH
20 template<
template<
class,
class >
class Operation,
template<
int >
class Value,
int first,
int last >
22 :
public Operation< Value< first >, GenericForLoop< Operation, Value, first+1, last > >
27 template<
template<
class,
class >
class Operation,
template<
int >
class Value,
int last >
28 class GenericForLoop< Operation, Value, last, last >
29 :
public Value< last >
35 namespace ForLoopHelper
38 template<
class A,
class B >
48 static void apply ( T1 &p1 )
54 template<
class T1,
class T2 >
55 static void apply ( T1 &p1, T2 &p2 )
61 template<
class T1,
class T2,
class T3 >
62 static void apply ( T1 &p1, T2 &p2, T3 &p3 )
64 A::apply( p1, p2, p3 );
65 B::apply( p1, p2, p3 );
68 template<
class T1,
class T2,
class T3,
class T4 >
69 static void apply ( T1 &p1, T2 &p2, T3 &p3, T4 &p4 )
71 A::apply( p1, p2, p3, p4 );
72 B::apply( p1, p2, p3, p4 );
75 template<
class T1,
class T2,
class T3,
class T4,
class T5 >
76 static void apply ( T1 &p1, T2 &p2, T3 &p3, T4 &p4, T5 &p5 )
78 A::apply( p1, p2, p3, p4, p5 );
79 B::apply( p1, p2, p3, p4, p5 );
82 template<
class T1,
class T2,
class T3,
class T4,
class T5,
class T6 >
83 static void apply ( T1 &p1, T2 &p2, T3 &p3, T4 &p4, T5 &p5, T6 &p6 )
85 A::apply( p1, p2, p3, p4, p5, p6 );
86 B::apply( p1, p2, p3, p4, p5, p6 );
89 template<
class T1,
class T2,
class T3,
class T4,
class T5,
class T6,
91 static void apply ( T1 &p1, T2 &p2, T3 &p3, T4 &p4, T5 &p5, T6 &p6,
94 A::apply( p1, p2, p3, p4, p5, p6, p7 );
95 B::apply( p1, p2, p3, p4, p5, p6, p7 );
98 template<
class T1,
class T2,
class T3,
class T4,
class T5,
class T6,
100 static void apply ( T1 &p1, T2 &p2, T3 &p3, T4 &p4, T5 &p5, T6 &p6,
103 A::apply( p1, p2, p3, p4, p5, p6, p7, p8 );
104 B::apply( p1, p2, p3, p4, p5, p6, p7, p8 );
107 template<
class T1,
class T2,
class T3,
class T4,
class T5,
class T6,
108 class T7,
class T8,
class T9 >
109 static void apply ( T1 &p1, T2 &p2, T3 &p3, T4 &p4, T5 &p5, T6 &p6,
110 T7 &p7, T8 &p8, T9 &p9 )
112 A::apply( p1, p2, p3, p4, p5, p6, p7, p8, p9 );
113 B::apply( p1, p2, p3, p4, p5, p6, p7, p8, p9 );
116 template<
class T1,
class T2,
class T3,
class T4,
class T5,
class T6,
117 class T7,
class T8,
class T9,
class T10 >
118 static void apply ( T1 &p1, T2 &p2, T3 &p3, T4 &p4, T5 &p5, T6 &p6,
119 T7 &p7, T8 &p8, T9 &p9, T10 &p10 )
121 A::apply( p1, p2, p3, p4, p5, p6, p7, p8, p9, p10 );
122 B::apply( p1, p2, p3, p4, p5, p6, p7, p8, p9, p10 );
125 template<
class T1,
class T2,
class T3,
class T4,
class T5,
class T6,
126 class T7,
class T8,
class T9,
class T10,
class T11 >
127 static void apply ( T1 &p1, T2 &p2, T3 &p3, T4 &p4, T5 &p5, T6 &p6,
128 T7 &p7, T8 &p8, T9 &p9, T10 &p10, T11 &p11 )
130 A::apply( p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11 );
131 B::apply( p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11 );
134 template<
class T1,
class T2,
class T3,
class T4,
class T5,
class T6,
135 class T7,
class T8,
class T9,
class T10,
class T11,
class T12 >
136 static void apply ( T1 &p1, T2 &p2, T3 &p3, T4 &p4, T5 &p5, T6 &p6,
137 T7 &p7, T8 &p8, T9 &p9, T10 &p10, T11 &p11,
140 A::apply( p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12 );
141 B::apply( p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12 );
144 template<
class T1,
class T2,
class T3,
class T4,
class T5,
class T6,
145 class T7,
class T8,
class T9,
class T10,
class T11,
class T12,
147 static void apply ( T1 &p1, T2 &p2, T3 &p3, T4 &p4, T5 &p5, T6 &p6,
148 T7 &p7, T8 &p8, T9 &p9, T10 &p10, T11 &p11,
151 A::apply( p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13 );
152 B::apply( p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13 );
220 template<
template<
int >
class Operation,
int first,
int last >
222 :
public GenericForLoop< ForLoopHelper::Apply, Operation, first, last >
224 dune_static_assert( (first <= last),
"ForLoop: first > last" );
A static loop using TMP.
Definition: forloop.hh:223
#define dune_static_assert(COND, MSG)
Helper template so that compilation fails if condition is not true.
Definition: static_assert.hh:79
Dune namespace.
Definition: alignment.hh:14
Fallback implementation of the C++0x static_assert feature.