diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2010-02-21 19:55:17 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2010-02-21 19:55:17 +0000 |
commit | 681f05d4f0195b8566bdc0c985afb6ac4cd95069 (patch) | |
tree | bad7267e444c4d59597fc04451de59d8097bb362 /libstdc++-v3/include/tr1 | |
parent | 04afbf1c7feeaecd4d0e85bd2566ef3e65e84b21 (diff) | |
download | gcc-681f05d4f0195b8566bdc0c985afb6ac4cd95069.tar.gz |
complex (proj): Change return type per DR 1137.
2010-02-21 Paolo Carlini <paolo.carlini@oracle.com>
* include/std/complex (proj): Change return type per DR 1137.
(conj): Copy from tr1_impl, likewise adjust return type.
* include/tr1_impl/complex (conj): Remove.
* include/tr1/complex (conj): Add both overloads.
* testsuite/26_numerics/complex/dr781.cc: Rename to...
* testsuite/26_numerics/complex/dr781_dr1137.cc: ... this, and extend.
* include/tr1_impl/complex (arg): Optimize.
From-SVN: r156940
Diffstat (limited to 'libstdc++-v3/include/tr1')
-rw-r--r-- | libstdc++-v3/include/tr1/complex | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/libstdc++-v3/include/tr1/complex b/libstdc++-v3/include/tr1/complex index 3ed1eb97f67..063112b440b 100644 --- a/libstdc++-v3/include/tr1/complex +++ b/libstdc++-v3/include/tr1/complex @@ -1,6 +1,6 @@ // TR1 complex -*- C++ -*- -// Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation, Inc. +// Copyright (C) 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -56,7 +56,17 @@ namespace std namespace tr1 { using std::arg; - using std::conj; + + template<typename _Tp> + inline std::complex<_Tp> + conj(const std::complex<_Tp>& __z) + { return std::conj(__z); } + + template<typename _Tp> + inline std::complex<typename __gnu_cxx::__promote<_Tp>::__type> + conj(_Tp __x) + { return __x; } + using std::imag; using std::norm; using std::polar; |