Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2008-07-19 14:44:43


Looks to me like you get O(n^2) instantiations of advance. You get N
instantiations for the begin iterator, N-1 for the next and so on.
What am I missing?

--
Dave Abrahams
Boostpro Computing
http://boostpro.com
On Jul 19, 2008, at 1:13 PM, Steven Watanabe <watanabesj_at_[hidden]>  
wrote:
> 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
>
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
>

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