<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi,<br>
<blockquote
cite="mid:0EC3E4BF-4FD1-4280-9EAA-D7265213FF83@sintef.no"
type="cite">
<pre wrap="">
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).</pre>
</blockquote>
Isn't this one of those cases where the new C++11 return type
deduction should<br>
save us a lot of hassle? Instead of (paraphrasing)<br>
<br>
real_type abs() <br>
{<br>
return magic_abs();<br>
}<br>
<br>
write<br>
<br>
auto abs() --> decltype(magic_abs())<br>
{<br>
return magic_abs();<br>
}<br>
<br>
As far as I know compiler support for this is good enough (and in
fact I have used<br>
it in dune-istl without getting any complaints yet).<br>
<br>
Best,<br>
Oliver<br>
<br>
<br>
<blockquote
cite="mid:0EC3E4BF-4FD1-4280-9EAA-D7265213FF83@sintef.no"
type="cite">
<pre wrap="">
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
</pre>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Dune-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Dune-devel@dune-project.org">Dune-devel@dune-project.org</a>
<a class="moz-txt-link-freetext" href="http://lists.dune-project.org/mailman/listinfo/dune-devel">http://lists.dune-project.org/mailman/listinfo/dune-devel</a>
</pre>
</blockquote>
<br>
</body>
</html>