Core: AsString for std::complex

git-svn-id: svn://ultimatepp.org/upp/trunk@3891 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2011-09-20 06:23:38 +00:00
parent 7fba1a64b5
commit 5bcf61e9cd

View file

@ -20,7 +20,8 @@ struct Complex : std::complex<double>
template<> inline bool IsNull(const Complex& r) { return r.real() < DOUBLE_NULL_LIM || r.imag() < DOUBLE_NULL_LIM; }
template<> inline unsigned GetHashValue(const Complex& x) { return CombineHash(x.real(), x.imag()); }
template<> inline String AsString(const Complex& x) { return String().Cat() << "(" << x.real() << "," << x.imag() << ")"; }
template<> inline String AsString(const std::complex<double>& x) { return String().Cat() << "(" << x.real() << "," << x.imag() << ")"; }
template<> inline String AsString(const Complex& x) { return AsString((const std::complex<double>&)x); }
template<> inline Stream& operator%(Stream& s, Complex& c)
{