
Eric Niebler wrote:
There is another solution. Give rules value semantics by default as I suggest, but require people to use special syntax to get reference semantics.
I hate replying to myself. ;-) I realize this doesn't give true value semantics. A rule which refers to itself (that is, it indirectly stores a pointer to itself) cannot be copied around and put inside containers and whatnot. Then I thought that it could be solved with an extra layer of indirection -- shared_ptr to a shared_ptr (ugh!) but then you have problems with cyclic references. Hence Joel's comment about garbage collection -- he's probably been through this thought process before. I think I need to think it out again. -- Eric Niebler Boost Consulting www.boost-consulting.com