Chombo + EB  3.0
Public Member Functions | List of all members
Metaprograms::NestedLoop< N, OP > Struct Template Reference

#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
 

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

Member Function Documentation

◆ operator()() [1/2]

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

◆ operator()() [2/2]

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

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