Metaprograms::NestedLoop< N, OP > Struct Template Reference

#include <Metaprograms.H>

List of all members.


Detailed Description

template<int N, class OP>
struct Metaprograms::NestedLoop< N, OP >

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 ); }

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


Member Function Documentation

template<int N, class OP>
void Metaprograms::NestedLoop< N, OP >::operator() ( int *  index,
int  lo,
int  hi,
OP &  op 
) const [inline]

References N.

template<int N, class OP>
void Metaprograms::NestedLoop< N, OP >::operator() ( int *  index,
const int *  lo,
const int *  hi,
OP &  op 
) const [inline]

References N.


The documentation for this struct was generated from the following file:

Generated on Sat Jun 24 03:28:07 2017 for Chombo + EB + MF by  doxygen 1.5.5