"Duane Murphy"
David, I'm only working with the boost documentation; I don't have the book, so I could not understand your suggestion using fold<>. It didn't seem to match the template.
typedef fold
::type t;
Uh, yeah, I got the argument order wrong. Exchange the last two, please.
I further didn't understand the NextFunctionType argument. Maybe the book would make this more clear. :-)
try_derived_class and do_nothing are "function object types." The algorithm tries each derived class in sequence by calling a specialization of try_derived_class for that class, and then calls do_nothing when it runs out of types. NextFunctionType is, well, the next function type to invoke on the pointer in case this dynamic cast fails. -- Dave Abrahams Boost Consulting www.boost-consulting.com