[Dune] Unnecessary reinterpret_cast in AlbertaGrid

Martin Nolte nolte at mathematik.uni-freiburg.de
Wed Dec 2 20:15:30 CET 2009


We are talking about a deprecated method (operator []). The way I see it, there
are 3 possibilities:
(a) reinterpret_cast double[ dim ] to FieldVector< double, dim >
(b) DUNE_THROW( NotImplemented )
(c) return a reference to a static variable held within the method

I decided for (a) because it does what is most expected: It simply works (unless
you use gcc-4.4). Is there another solution or is (b) or (c) preferable to (a)?
What do you think?

Martin

Christian Engwer wrote:
> I believe the following cast is not necessary.
> 
> ./dune/grid/albertagrid/geometry.hh:495:      return reinterpret_cast<
> const GlobalVector & >( elementInfo_.coordinate( i ) );
> 
> Martin... could you comment on this?
> 
> Christian
> 
> _______________________________________________
> Dune mailing list
> Dune at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune

-- 
Martin Nolte <nolte at mathematik.uni-freiburg.de>

Universität Freiburg                                   phone: +49-761-203-5642
Abteilung für angewandte Mathematik                    fax:   +49-761-203-5632
Hermann-Herder-Straße 10
79104 Freiburg, Germany




More information about the Dune mailing list