summaryrefslogtreecommitdiff
path: root/libstdc++-v3/include/tr1/complex
diff options
context:
space:
mode:
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2008-05-22 11:44:00 +0000
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2008-05-22 11:44:00 +0000
commitdf2fcd57a0d36fe257b6e75ee53cd1ac953f04d7 (patch)
tree9e2d6af57d9f02cf4dc711a80839eb7e6dac1cf7 /libstdc++-v3/include/tr1/complex
parent8aee17d5b2c7300749620cfd7f2fcb421070c990 (diff)
downloadgcc-df2fcd57a0d36fe257b6e75ee53cd1ac953f04d7.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@135757 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/include/tr1/complex')
-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;
}
}