
Larry Evans <cppljevans@cox-internet.com> writes:
On 08/18/2005 12:07 AM, Bruno MartÃnez wrote:
On Wed, 17 Aug 2005 15:29:51 -0300, Larry Evans [snip]
Makes perfect sense to me. The fold metafunction calculates a sequence of partial results which can then be accessed with child_i_depth_j as shown in test driver in:
The recursion in child_i_depth_j is a tail call. IIUC, the recursion is like the first drop, so increasing depths don't share part of the calculation. However, it could be written in the other style.
Yeah, you're right. I was thinking more of how fold was done. It calculates all the intermediate results, but leaves no way to access them.
Of course you can use fold to build an O(1) access structure like vector or a map containing all of your intermediate results, and then access that. -- Dave Abrahams Boost Consulting www.boost-consulting.com