On Feb 9, 2009, at 1:43 PM, Roy Stogner wrote:
> Apparently the compiler can't figure out where to find a vtable
> pointer unless it at least knows what the root base class is you're
> pointing to, and it can't figure out how to do a proper cast (at least
> in the context of multiple inheritance) without grabbing some kind of
> global offset information from there.
Ah - makes sense.
> You're handing PETSc a context and then getting handed it back in a
> callback function, right? Your only safe choice is probably to make
> sure that everything you hand PETSc in the same sort of context is a
> subclass of the same root, then static_cast to that root, then if you
> later find out that you both have and need a specific subclass you can
> libmesh_cast_ptr to that class from the root.
Indeed... this is a place I would have just used static_cast() in the
past without thinking about it... but now that you made these handy
functions I'm trying to be a good citizen and make use of them ;-)
Because of that I didn't give it the thought it required ;-)