[Developers] Const correctness for cGH *

Jonathan Thornburg jthorn at aei.mpg.de
Mon Jun 6 11:11:42 CDT 2005

On Sun, 5 Jun 2005, Erik Schnetter wrote:
> We should decide: Either the cGH structure should be const qualified in
> thorns, or it should not be.  If it is const, then the few thorns that
> need to modify the cGH structure (Time, CartGrid3D, drivers) can easily
> cast the const away in the few places where they need to modify things.

Yes, make it const!

> (My case was an aliased function which calls another function
> that takes CCTK_ARGUMENTS.)

What I do in cases like this is to cast it to  const void*  and pass
it as CCTK_POINTER_TO_CONST.  But having a nicely typed   const cGH*
would be nice...


-- Jonathan Thornburg <jthorn at aei.mpg.de>
    Max-Planck-Institut fuer Gravitationsphysik (Albert-Einstein-Institut),
    Golm, Germany, "Old Europe"     http://www.aei.mpg.de/~jthorn/home.html
    "Washing one's hands of the conflict between the powerful and the
     powerless means to side with the powerful, not to be neutral."
                                       -- quote by Freire / poster by Oxfam

More information about the Developers mailing list