[Dune-devel] [PATCH] Use unqualified calls to allow ADL.
Oliver Sander
oliver.sander at tu-dresden.de
Thu Sep 3 13:34:02 CEST 2015
Am 03.09.2015 um 13:29 schrieb Christian Engwer:
> 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.
I'm only speaking about master. As for 2.4, I'd rather avoid patches that change template
lookup behavior this late in the release process.
Best,
Oliver
>
> 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
>
More information about the Dune-devel
mailing list