2008/4/13, Garth N. Wells <gnw20@xxxxxxxxx>:
In the down casting functions in GenericTensor, what's the difference
between
T* t = dynamic_cast<T*>(instance());
and
T* t = dynamic_cast<T*>(this);
?
// Assume this is configured to use a PETScVector:
GenericVector * v = new Vector();
// This won't work:
PETScVector * pv = dynamic_cast<PETScVector*>(v);
// This will work (and is what down_cast does):
PETScVector * pv = dynamic_cast<PETScVector*>(v->instance());
This was the only intended usage for instance().