This is the mail archive of the libstdc++@sources.redhat.com mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

conj: from multiple version to none ?



It looks like the conj operator in complex.h (that seems to have been 
once defined twice according to the Changelog) has completely
disappeared.... And I do not understand why, since it seems to work 
perfectly for me. Is this some kind of parallel removal, or there is 
a deeper reason that I missed.

For the record, the following patch, restores a working conj for me 
(I also added the long double case).

ChangeLog:

2000-11-08 Theodore Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr>

    * include/bits/std_complex.h: Re-enable conj. Added a version for
    long double.

Index: include/bits/std_complex.h
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/include/bits/std_complex.h,v
retrieving revision 1.6
diff -c -3 -p -r1.6 std_complex.h
*** std_complex.h	2000/11/02 00:21:07	1.6
--- std_complex.h	2000/11/06 13:42:22
*************** namespace std
*** 185,190 ****
--- 185,191 ----
      friend complex<float> sqrt<>(const complex<float>&);
      friend complex<float> tan<>(const complex<float>&);
      friend complex<float> tanh<>(const complex<float>&);
+     friend complex<float> conj<>(const complex<float>&);
    };
  
    inline float
*************** namespace std
*** 250,255 ****
--- 251,257 ----
      friend complex<double> sqrt<>(const complex<double>&);
      friend complex<double> tan<>(const complex<double>&);
      friend complex<double> tanh<>(const complex<double>&);
+     friend complex<double> conj<>(const complex<double>&);
    };
  
    inline double
*************** namespace std
*** 318,323 ****
--- 320,326 ----
      friend complex<long double> sqrt<>(const complex<long double>&);
      friend complex<long double> tan<>(const complex<long double>&);
      friend complex<long double> tanh<>(const complex<long double>&);
+     friend complex<long double> conj<>(const complex<long double>&);
    };
  
    inline
*************** namespace std
*** 913,935 ****
      polar(const _Tp& __rho, const _Tp& __theta)
      { return complex<_Tp>(__rho * cos(__theta), __rho * sin(__theta)); }
  
! //    // We use here a few more specializations.
! //    template<>
! //      inline complex<float>
! //      conj(const complex<float> &__x)
! //  #ifdef _GLIBCPP_BUGGY_FLOAT_COMPLEX
! //      {
! //        complex<float> __tmpf(~__x._M_value);
! //        return __tmpf;
! //      }
! //  #else
! //    { return complex<float>(~__x._M_value); }
! //  #endif
! 
! //    template<>
! //      inline complex<double>
! //      conj(const complex<double> &__x)
! //      {  return complex<double> (~__x._M_value); }
  
    // Transcendentals:
    template<typename _Tp>
--- 916,943 ----
      polar(const _Tp& __rho, const _Tp& __theta)
      { return complex<_Tp>(__rho * cos(__theta), __rho * sin(__theta)); }
  
!   // We use here a few more specializations.
!   template<>
!     inline complex<float>
!     conj(const complex<float> &__x)
! #ifdef _GLIBCPP_BUGGY_FLOAT_COMPLEX
!     {
!       complex<float> __tmpf(~__x._M_value);
!       return __tmpf;
!     }
! #else
!   { return complex<float>(~__x._M_value); }
! #endif
! 
!   template<>
!     inline complex<double>
!     conj(const complex<double> &__x)
!     {  return complex<double> (~__x._M_value); }
! 
!   template<>
!     inline complex<long double>
!     conj(const complex<long double> &__x)
!     {  return complex<long double> (~__x._M_value); }
  
    // Transcendentals:
    template<typename _Tp>

 --------------------------------------------------------------------
 Theodore Papadopoulo
 Email: Theodore.Papadopoulo@sophia.inria.fr Tel: (33) 04 92 38 76 01
 --------------------------------------------------------------------



PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]