aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/include/tr1
diff options
context:
space:
mode:
authorpaolo <>2008-05-22 10:44:00 +0000
committerpaolo <>2008-05-22 10:44:00 +0000
commit593524752459a1feafd0e15f4fc18b13546a5f97 (patch)
tree9e2d6af57d9f02cf4dc711a80839eb7e6dac1cf7 /libstdc++-v3/include/tr1
parent35957a5f6aeb5e7d7cc91094189515272fc6bf0f (diff)
2008-05-22 Paolo Carlini <paolo.carlini@oracle.com>
* include/std/complex (proj(const std::complex<>&), proj(_Tp)): Add per DR 781. * include/tr1_impl/complex(polar(const _Tp&, const _Up&)): Move to... * include/tr1/complex: ... here. * doc/xml/manual/intro.xml: Add an entry for DR 781. * testsuite/26_numerics/complex/dr781.cc: Add. * acinclude.m4 ([GLIBCXX_ENABLE_C99]): Update. * configure: Regenerate.
Diffstat (limited to 'libstdc++-v3/include/tr1')
-rw-r--r--libstdc++-v3/include/tr1/complex13
1 files changed, 11 insertions, 2 deletions
diff --git a/libstdc++-v3/include/tr1/complex b/libstdc++-v3/include/tr1/complex
index a0a84911698..8d14681e955 100644
--- a/libstdc++-v3/include/tr1/complex
+++ b/libstdc++-v3/include/tr1/complex
@@ -1,6 +1,6 @@
// TR1 complex -*- C++ -*-
-// Copyright (C) 2006, 2007 Free Software Foundation, Inc.
+// Copyright (C) 2006, 2007, 2008 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
@@ -65,8 +65,17 @@ namespace tr1
using std::imag;
using std::norm;
using std::polar;
- using std::pow;
+
+ template<typename _Tp, typename _Up>
+ inline std::complex<typename __gnu_cxx::__promote_2<_Tp, _Up>::__type>
+ polar(const _Tp& __rho, const _Up& __theta)
+ {
+ typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
+ return std::polar(__type(__rho), __type(__theta));
+ }
+
using std::real;
+ using std::pow;
}
}