3
0
mirror of https://github.com/triqs/dft_tools synced 2024-12-25 05:43:40 +01:00

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
This commit is contained in:
Olivier Parcollet 2013-12-21 20:07:52 +01:00
parent dce4edbdde
commit 8cc5012347

View File

@ -24,11 +24,14 @@
#include <boost/preprocessor/seq/for_each.hpp>
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<double> conj(double x) { return x; }
#endif
//C++14 will simply be ...
//template <typename A> decltype(auto) abs(A && a) { return map( [](auto const &x) { using std::abs; return abs(a);}, std::forward<A>(a));}