Boost logo

Boost :

From: dan marsden (danmarsden_at_[hidden])
Date: 2007-07-17 17:39:10


Eric Niebler wrote:
>Dan, this is a job for a custom generator. (Thanks, I haven't had need
>of one until now! This'll make a great example.) You're already using a
>generator to wrap your expressions. But you also need a deep_copy-ing
>generator. Here's the basic idea ...

<snip really useful example>

Thanks, that looks like exactly what I was looking for. Glad to provide
a handy example problem for the customer generators!

>Of course, calling deep_copy() in the generator is sub-optimal. Every
>part of the tree has been deep_copied already except the top-most node.
>When I find time, I'll write a by_value_generator which makes sure
>everything in the tree is held by value.

Cool, I'll keep an eye out for by_value_generator.

>(I'm using the BOOST_PROTO_EXTENDS macros here instead of
>proto::extends<> so that _1 can be statically initialized. You may want
>to do something similar, if you aren't already.)

I've not been using these yet, although I had encountered the static init
issues. I'll switch to using the macros as well, thanks for pointing them
out.

Cheers

Dan

      ___________________________________________________________
Yahoo! Answers - Got a question? Someone out there knows the answer. Try it
now.
http://uk.answers.yahoo.com/


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