On 25 September 2013 06:41, Marc Glisse wrote: > On Wed, 25 Sep 2013, Jonathan Wakely wrote: > >> I've had this sitting in my tree waiting to do something with, > > > I did ask last week if someone had done it already...
Sorry :-\ > >> I'm about to go to sleep so didn't check if the test covers anything yours >> doesn't. > > > In the test you have basic cover for all functors, and I cover only 2 cases > (more specifically though, since I look at the return type cv-qual). > > In my patch, I added constexpr and noexcept, I couldn't see any reason not > to for such basic utilities. Yes, I did read the wiki and noticed the vote > yesterday about constexpr, but imho that's wrong. > > >> It looks like your patch adds the default template argument even in >> C++98 mode, I avoided that by putting forward declarations at the top >> of the file, in a #if block. > > > This only lets me write: > std::plus<> *p; > in C++98 mode (std::plus<> p; gives an error), doesn't seem that bad. > > And I also add the void specializations in C++11 mode, as an extension. > > Well, let's forget my patch and go with yours, though at least adding > noexcept seems like a good idea. Yes, noexcept is a good idea. > (too bad we don't have noexcept(auto) here) > (too bad we can't use decltype(auto) for the return type, as that would > disable sfinae, it is a bad sign when the standard turns its nose up at its > own dog food...) Yeah, I think the idea is that concepts will make SFINAE a thing of the past, but we're not there yet.