Commit d0cad9fe by Jonathan Wakely Committed by Jonathan Wakely

* include/std/complex (polar): Check for negative rho (LWG 2459).

From-SVN: r223159
parent ac68f97c
2015-05-13 Jonathan Wakely <jwakely@redhat.com>
* include/std/complex (polar): Check for negative rho (LWG 2459).
* include/experimental/tuple (apply): Handle pointers to member (LWG
2418).
* include/std/functional (_Mem_fn_base): Make constructors constexpr.
......
......@@ -667,7 +667,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
template<typename _Tp>
inline complex<_Tp>
polar(const _Tp& __rho, const _Tp& __theta)
{ return complex<_Tp>(__rho * cos(__theta), __rho * sin(__theta)); }
{
_GLIBCXX_DEBUG_ASSERT( __rho >= 0 );
return complex<_Tp>(__rho * cos(__theta), __rho * sin(__theta));
}
template<typename _Tp>
inline complex<_Tp>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment