This is the mail archive of the libstdc++@gcc.gnu.org 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]
Other format: [Raw text]

Re: [C++ Patch] for c++/54537


2012/9/18 Paolo Carlini <paolo.carlini@oracle.com>:

> I don't understand: what's wrong - exactly - with the std::tr1::pow (double, double) overload above? Now I can't immediately check, but do the EDG and CLANG front ends accept it or not?

They don't. The problem is that it conflicts with ::pow(double,double).

// in GLIBC math.h
extern double pow (double __x, double __y) throw (); // (1)

// in std::tr1::cmath
namespace std { namespace tr1 {
inline double
pow(double __x, double __y)
{ return std::pow(__x, __y); }
}}

// in std::tr1::math.h
using std::tr1::pow; // this one conflicts with (1)

The removal of std::tr1::pow is surely wrong, on second though, I
think we should perhaps do:
namespace std { namespace tr1 { using std::pow; }}

But I see the comment below in std::tr1::math.h...

// DR 550. What should the return type of pow(float,int) be?
  // NB: C++0x and TR1 != C++03.
  //   using std::pow;

What do you think ?


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