Chombo + EB
3.0
|
#include <Metaprograms.H>
Public Member Functions | |
void | operator() (int *index, int lo, int hi, OP &op) const |
void | operator() (int *index, const int *lo, const int *hi, OP &op) const |
Arbitrarily deep nested loop. Example: This code will print all the integers from 0 to B^N-1, in base B:
template<int N> struct BaseRep { void operator()( int* index ) { for ( int i=N-1; i>=0; –i ) std::cout << index[i]; std::cout << '
'; } };
main() { #define N 4 #define B 3 int index[N]; BaseRep<N> op; Metaprograms::NestedLoop< N,BaseRep<N> >()( index, 0, B, op ); }
|
inline |
|
inline |