On 10/22/2010 8:53 AM, Eric Niebler wrote:
On 10/21/2010 12:13 PM, Joel de Guzman wrote:

Do you mean that it has to be exactly that to be called a "visitor"?
How exact? Does it have to be "an OO hierarchy with a virtual "Dispatch"
member that accepts a visitor"?

No, there's some wiggle room. I tried to state in a latter message what
I think the essence of the visitor design pattern is.

Does the Boost Variant visitation scheme (for example) satisfy these

The essentials are there, yeah. There is an implicit hierarchy, the root
of which is, say, variant<A,B,C>. The subtypes are A, B and C. It's not
a classic OO hierarchy, but admittedly that's not essential. There is a
visitor. There are two dispatches: one on the "dynamic" type of the
variant, either A, B, or C. There is second dispatch based on the type
of the visitor. Pretty straightforward.

Can you do a similar analysis for Thomas' code? I tried and am not
certain about my results.

I am trying. I owe you guys some.

Joel de Guzman

proto mailing list

Reply via email to