libstdc++/4543: std_complex should give polar a default arg

brendan@zen.org brendan@zen.org
Thu Oct 11 08:16:00 GMT 2001


>Number:         4543
>Category:       libstdc++
>Synopsis:       std_complex should give polar a default arg
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Oct 11 08:16:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Brendan Kehoe
>Release:        CVS tree
>Organization:
>Environment:

>Description:
Library DR #79 resolved that the second argument to polar should be a default argument initialized to 0.  Otherwise, calls to polar with only one argument will result in complaints that there is no available candidate.
>How-To-Repeat:

>Fix:
See attached patch.
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/plain; name="diffs-complex-1.txt"
Content-Disposition: inline; filename="diffs-complex-1.txt"

*** include/bits/std_complex.h.~1~	Mon Aug 13 17:22:12 2001
--- include/bits/std_complex.h	Thu Oct 11 16:09:39 2001
*************** namespace std
*** 57,61 ****
  
    template<typename _Tp> complex<_Tp> conj(const complex<_Tp>&);
!   template<typename _Tp> complex<_Tp> polar(const _Tp&, const _Tp&);
  
    // Transcendentals:
--- 57,61 ----
  
    template<typename _Tp> complex<_Tp> conj(const complex<_Tp>&);
!   template<typename _Tp> complex<_Tp> polar(const _Tp&, const _Tp& = 0);
  
    // Transcendentals:
*************** namespace std
*** 428,432 ****
    template<typename _Tp>
      inline complex<_Tp>
!     polar(const _Tp& __rho, const _Tp& __theta)
      { return complex<_Tp>(__rho * cos(__theta), __rho * sin(__theta)); }
  
--- 428,432 ----
    template<typename _Tp>
      inline complex<_Tp>
!     polar(const _Tp& __rho, const _Tp& __theta = 0)
      { return complex<_Tp>(__rho * cos(__theta), __rho * sin(__theta)); }
  



More information about the Gcc-bugs mailing list