This is the mail archive of the
mailing list for the GCC project.
Re: [v3] plus<void>
- From: Marc Glisse <marc dot glisse at inria dot fr>
- To: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- Cc: libstdc++ <libstdc++ at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 25 Sep 2013 07:41:09 +0200 (CEST)
- Subject: Re: [v3] plus<void>
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot DEB dot 2 dot 02 dot 1309250025470 dot 25959 at stedding dot saclay dot inria dot fr> <CAH6eHdRwm0+KNz86A37-Zih4Q_=5iwEDdYH+VcBpV9GEr-U96g at mail dot gmail dot com>
- Reply-to: libstdc++ at gcc dot gnu dot org
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...
I'm about to go to sleep so didn't check if the test covers anything
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:
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.
(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...)