[Dune-devel] Reference and pointer type when dereferencing EntityPointer

Markus Blatt markus at dr-blatt.de
Mon Oct 20 11:36:19 CEST 2014


On Tue, Oct 14, 2014 at 01:25:20PM +0200, Steffen Müthing wrote:
> 
> Am 14.10.2014 um 10:05 schrieb Christian Engwer <christian.engwer at uni-muenster.de>:
> 
> > Hi Steffen,
> > 
> >> to my rather big surprise I just learned that operator* and operator-> in the EntityPointer facade
> >> have always returned the Entity by non-const reference / pointer. It has been like that pretty much
> >> forever (those lines were last changed in 2005!).
> > 
> > I'm tempted to say that is due to our limited C++ experience in the
> > older days... The entity had only const methods, so at the first glace
> > one solution was as good as the other. And obviously nobody every
> > properly looked at it after the first couple of years.
> 
> OK, in that case I propose making those return types const. If nobody cries foul until
> tomorrow, I’ll push the change.

Why not yesterday instead of tomorrow? I was not online for one week,
therefore it would have not mattered anyway. :/

Being back I am yelling now! Moving from a mutable return type to a
const one is disruptive and tends to break usercode.

Markus


-- 
Do you need more support with DUNE or HPC in general? 

Dr. Markus Blatt - HPC-Simulation-Software & Services http://www.dr-blatt.de
Hans-Bunte-Str. 8-10, 69123 Heidelberg, Germany
Tel.: +49 (0) 160 97590858
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <https://lists.dune-project.org/pipermail/dune-devel/attachments/20141020/fe7eccf0/attachment.sig>


More information about the Dune-devel mailing list