[v3] complex functions with expression template reals
Marc Glisse <marc.glisse <at> inria.fr>
2014-02-23 10:32:48 GMT
looking at this question:
I was surprised to see that libstdc++'s std::complex basically just works
with user-defined types, even weird expression template ones, although
that's not a supported use afaik.
The only functions that fail seem to be exp and pow, both because they
call polar with two arguments that have different (expression) types.
I am not proposing to make this a supported use, but the cost of this
small patch seems very low, and if it makes a couple users happy...
Regtested with no problem on x86_64-linux-gnu, ok for stage 1?
2014-02-23 Marc Glisse <marc.glisse <at> inria.fr>
* include/std/complex (__complex_exp, pow): Specify the template
parameter in calls to std::polar, for expression templates.
--- libstdc++-v3/include/std/complex (revision 208045)
+++ libstdc++-v3/include/std/complex (working copy)
<at> <at> -728,21 +728,21 <at> <at> _GLIBCXX_BEGIN_NAMESPACE_VERSION