[petsc-dev] macro wrappers around functions to caste suck

Jed Brown jedbrown at mcs.anl.gov
Sun Apr 7 17:02:59 CDT 2013


Barry Smith <bsmith at mcs.anl.gov> writes:

>   Seems inconsistent to only handle the cast automatically for
>   some. We should do it all or nothing. That is be C++ish and let the
>   user always pass a subclass where the class is expected or be C ish
>   and always require the cast.

Unfortunately, there is no way to allow implicit conversion for
subclasses without implicitly converting everything.  The explicit cast
is visually jarring enough to make it obvious at the call site that that
argument must be a PetscObject.  I'm pretty indifferent about changing
it.



More information about the petsc-dev mailing list