From 257596081d6e539bfd2ca53ac9703ba86accd8bb Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Mon, 14 Sep 2015 02:34:03 -0500 Subject: [PATCH] Bugfix: Support complex_overloads.h also in C++11 mode [Wow. This is the first time that I broke something in C++11 mode - I didn't realize that I was still in C++98 mode when testing...] Manually specify all products that shall be available in ProductType - otherwise our overloads cannot be used. --- include/deal.II/base/template_constraints.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/include/deal.II/base/template_constraints.h b/include/deal.II/base/template_constraints.h index acdc8d3066..bc44e7105e 100644 --- a/include/deal.II/base/template_constraints.h +++ b/include/deal.II/base/template_constraints.h @@ -461,6 +461,13 @@ struct ProductType typedef float type; }; +#endif + +// Annoyingly, there is no std::complex::operator*(U) for scalars U +// other than T (not even in C++11, or C++14). We provide our own overloads +// in base/complex_overloads.h, but in order for them to work, we have to +// manually specify all products we want to allow: + template struct ProductType,std::complex > { @@ -498,7 +505,6 @@ struct ProductType,float> typedef std::complex::type> type; }; -#endif /** -- 2.39.5