From: Larry Evans (cppljevans_at_[hidden])
Date: 2005-08-03 22:28:14
On 08/03/2005 08:51 PM, Jonathan Turkanis wrote:
> Larry Evans wrote:
>>child_i_depth_j allows the traversal of a tree of applications.
>>It's useful for accessing, for example, the i-th superclass of
>>the results of mpl/fold, as demonstrated by the test file:
>>included in the zip file mentioned in the subject line.
>>Could this be added to mpl? Is there something I could do
>>to facilitate this addition?
> Writing some documentation might help. For instance, what is an application? You
>>accessing, for example, the i-th superclass of
>>the results of mpl/fold,
For example, I've used fold to calculate the size of both a tuple and
variant. In order to access the offset of the j-th element of the
tuple, I can use child_i_depth_j. I've also used it to access the
j-th acceptor method in a class derived the variant. For a variant
of n elements, there are n acceptor methods, one for each element.
They are generated also with fold. Given that the value of the
variant's tag is a run-time value, I need to create a vector
of methods and access the appropriate acceptor method.... Oh it's
getting to complicated to explain. I'll just upload it to the vault.
> say it's defined in application_parts.hpp, but I don't see any definition there.
The comment under child_i_depth_j.zip in:
says it *uses* application_parts. It's defined in child_i_depth_j.hpp.
The only reason I mentioned application_parts was that the last time
I proposed application_parts I didn't have a real good application for
it. child_i_depth_j is such an application.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk