Boost logo

Boost :

From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2008-07-19 13:13:07


AMDG

David Abrahams wrote:
> How?

In pseudocode using iterators:

deref(advance(begin(tuple)), n)

where advance is implemented as

iterator advance(iterator x, int n) {
    if(n == 0) {
        return(x);
    } else {
        return(advance(x, n - 1));
    }
}

This way we maximize memoization for a single tuple.

In Christ,
Steven Watanabe


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk