Boost logo

Boost Users :

From: David Abrahams (dave_at_[hidden])
Date: 2005-10-06 09:06:18


"Duane Murphy" <duanemurphy_at_[hidden]> writes:

> 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<sequence,state,op>::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

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net