From 8cc5012347d99de9259d67c81c93f401bf7c00c0 Mon Sep 17 00:00:00 2001 From: Olivier Parcollet Date: Sat, 21 Dec 2013 20:07:52 +0100 Subject: [PATCH] Fix #42. Conj overload issue std::conj returns a complex according to std. On gcc, we need to define it (bug?) but on clang libc++ it is an error. -> one test is still failing : to be decided later --- triqs/arrays/mapped_functions.hpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/triqs/arrays/mapped_functions.hpp b/triqs/arrays/mapped_functions.hpp index 51206c17..d0a4eecd 100644 --- a/triqs/arrays/mapped_functions.hpp +++ b/triqs/arrays/mapped_functions.hpp @@ -24,11 +24,14 @@ #include namespace triqs { namespace arrays { + // not for libc++ (already defined) +#if !defined(_LIBCPP_VERSION) // complex conjugation for integers inline int conj(int x) { return x; } inline long conj(long x) { return x; } inline long long conj(long long x) { return x; } - inline double conj(double x) { return x; } + inline std::complex conj(double x) { return x; } +#endif //C++14 will simply be ... //template decltype(auto) abs(A && a) { return map( [](auto const &x) { using std::abs; return abs(a);}, std::forward(a));}