Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2006-11-10 21:44:33


Tobias Schwinger <tschwinger_at_[hidden]> writes:

> When traversing our "imaginary" (I use this adjective because there
> is no tree-shaped data structure, just an integer) we can emit code
> based on the node type and the steps performed during traversal (in
> detail: 'p ## n' for leafes, 'mpl::and<' when descending, '>' when
> ascending).
>
> There's no recursion in the PP, so we throw a state machine and a
> stack at the problem. Since we want to generate a right-balanced
> tree structure instead of a left-balanced one (like our imaginary
> tree), we implement traversal from right-to-left.
>
> Does that work?

I guess. Sounds like roughly what I'm doing.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

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