On Mon, 9 Feb 2009, Derek Gaston wrote:

> Why can't you cast a void pointer to a class pointer dynamically?
> Seems odd to me... so I'm probably doing something wrong.

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.

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.
---
Roy

------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
Libmesh-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-devel

Reply via email to