[Dune-devel] [PATCH] Use unqualified calls to allow ADL.

Christian Engwer christian.engwer at uni-muenster.de
Thu Sep 3 13:29:44 CEST 2015


Hi Oli,

I think for master this is a good appraoch. I assume that Atgeirr has
to support dune 2.4 as well and thus we also need a version which
works with the older compilers.

Christian

On Thu, Sep 03, 2015 at 01:21:26PM +0200, Oliver Sander wrote:
> Hi,
> > Thank you for your explanation, I have tested this and think it can work,
> > so consider this patch withdrawn. In our case the abs() function does not
> > return a double, but an Evaluation object, so to make things work we have
> > to set real_type to Evaluation. Do you see any pitfalls with this? It is not always
> > easy to tell what a particular type name is supposed to be used for: at least
> > real_type is used for the return value of math functions like abs(), sqrt() and also
> > for norms. For those uses I think the model supports our Evaluation class well
> > enough (we should return Evaluation from all those functions).
> Isn't this one of those cases where the new C++11 return type deduction should
> save us a lot of hassle?  Instead of (paraphrasing)
> 
> real_type abs()
> {
>   return magic_abs();
> }
> 
> write
> 
> auto abs() --> decltype(magic_abs())
> {
>   return magic_abs();
> }
> 
> As far as I know compiler support for this is good enough (and in fact I have used
> it in dune-istl without getting any complaints yet).
> 
> Best,
> Oliver
> 
> 
> >
> > Part of the confusion on my part was due to the fact that the ADL-enabling call
> > to abs() is a very recent change to Dune, and until recently I was using the
> > 2.3 branch. Happy to see it in 2.4!
> >
> > Atgeirr
> >
> >
> >
> >
> > _______________________________________________
> > Dune-devel mailing list
> > Dune-devel at dune-project.org
> > http://lists.dune-project.org/mailman/listinfo/dune-devel
> 

> _______________________________________________
> Dune-devel mailing list
> Dune-devel at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune-devel


-- 
Prof. Dr. Christian Engwer 
Institut für Numerische und Angewandte Mathematik
Fachbereich Mathematik und Informatik der Universität Münster
Einsteinstrasse 62
48149 Münster

E-Mail  christian.engwer at uni-muenster.de
Telefon +49 251 83-35067
FAX     +49 251 83-32729




More information about the Dune-devel mailing list