Metafunction
LoopReverse
Metafunction returning a function that iterates over a static integer range in reverse order.
LoopReverse<Worker, I>::run(Arg & arg)
Include Headers
seqan/basic.h
Parameters
Worker
A worker struct. It has to implement the static (and preferably finline/inline) function body that accepts two parameters. The first one will be a reference to arg, as given to run(). The second will be the current value of the iterating variable.
I
The upper limit for the iteration.
arg
The argument to be passed into the workers' body() function.
Remarks
The loop will go from I down to and including 1.
Examples
Print the values I, I - 1, ..., 2, 1.
struct PrintWorker
{
    static inline body(Nothing & arg, int I)
    {
        (void)arg;  // ignored
        printf("%d\n", I);
    }
};
 
Loop<PrintWorker, 10>::run(Nothing());
// This will print the numbers 1, 2, ..., 9, 10.
See Also
SeqAn - Sequence Analysis Library - www.seqan.de
 

Page built @2013/07/11 09:12:38