#ifndef TRIQS_UTILITY_COMPLEX_OPS_H #define TRIQS_UTILITY_COMPLEX_OPS_H #include #ifdef TRIQS_COMPILER_IS_C11_COMPLIANT inline std::complex operator"" _j ( long double x ) { return std::complex(0,x); } inline std::complex operator"" _j ( unsigned long long x ) { return std::complex(0,x); } #endif namespace std { // has to be in the right namespace for ADL ! template std::complex operator+(std::complex const & a, long b) { return a+T(b);} template std::complex operator+(long a, std::complex const & b) { return T(a)+b;} template std::complex operator-(std::complex const & a, long b) { return a-T(b);} template std::complex operator-(long a, std::complex const & b) { return T(a)-b;} template std::complex operator*(std::complex const & a, long b) { return a*T(b);} template std::complex operator*(long a, std::complex const & b) { return T(a)*b;} template std::complex operator/(std::complex const & a, long b) { return a/T(b);} template std::complex operator/(long a, std::complex const & b) { return T(a)/b;} } #endif