
11 Nov
2006
11 Nov
'06
2:44 a.m.
Tobias Schwinger <tschwinger@neoscientists.org> 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