[Dune-devel] [Dune-Commit] [Commit] dune-geometry - cb66db8: Add explicit conversion, needed when using high precision types like boost::multiprecision
Andreas Buhr
andreas at andreasbuhr.de
Fri Jun 13 14:05:48 CEST 2014
Hi Martin,
On 06/13/2014 01:28 PM, Martin Nolte wrote:
> Your compiler output
> indicates that you have not tested the option
>
> ctype dfcxn = (cxn > Traits::tolerance() || cxn < -Traits::tolerance())
> ? df / cxn : ctype(0);
>
> Does the compiler accept that?
The compiler accepts both:
... ? df / cxn : ctype(0);
and
... ? ctype(df / cxn) : 0;
The reason is that, according to ยง 5.3 paragraph 3 in the C++ standard
(draft):
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3337.pdf
<cite>
... if the second and third operand have different types and either has
(possibly cv-qualified) class type, or if both are glvalues of the same
value category and the same type except for cv-qualification, an attempt
is made to convert each of those operands to the type of the other.
</cite>
cheers,
Andreas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 901 bytes
Desc: OpenPGP digital signature
URL: <https://lists.dune-project.org/pipermail/dune-devel/attachments/20140613/b0a71837/attachment.sig>
More information about the Dune-devel
mailing list