hi, 2012/9/19 Paolo Carlini <paolo.carl...@oracle.com>: > Hi Fabien, > > > On 09/19/2012 07:29 PM, Fabien Chêne wrote: >>>> >>>> But I'm afraid this is still not completely correct, because if the user >>>> code has a using std::pow in the global namespace and then and include >>>> <tr1/cmath> the latter drags again in namespace std::tr1 the overloads >>>> pow >>>> (*, int) which we don't want there... grrrrr >> >> I'll add a testcase for this, if you agree. > > Sure, if you like (the never ending story of std::pow between C++99 and > C++11, I'm still meeting people missing the (*, int) overloads ;) > >>> You know what? All in all, I think we can go with your original idea of >>> just >>> removing the overload for (double, double): what I didn't realize the >>> first >>> time I saw the idea is that we have anyway the templatized pow which >>> forwards to std::pow. Thus, I suppose things should work pretty well. But >>> please add a big comment before the commented out overload. And let's see >>> if >>> over the next months somebody complaints, otherwise, I think it will be >>> enough for TR1, at this point. >>> >>> Thanks for your patience!!! >> >> It seems reasonable, I'll update the patch soon with the comment that >> you suggest. > > Thanks! (if you feel lazy about the comment, just add a couple of URLs to > the front-end issue and to this discussion, it's more than enough to > understand what's going on)
My apologize to come back after such a delay. The patch is almost ready, I was just wondering if we could add the specialization template<> inline double pow(double __x, double __y) { return std::pow(__x, __y); } (in tr1/math.h) instead of relying on the generic version, it passes testing as well. I doubt that it will change something, but perhaps it could be the case for unoptimized builds, I don't know (and I didn't take the time to check). Anyway, I find it a bit unusual, so just take it as a suggestion. I'll submit the patch with the version that you prefer. (sorry for the duplicated message, not sure what gmail is playing at wrt html mail format) -- Fabien