This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [v3] plus<void>
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: "libstdc++" <libstdc++ at gcc dot gnu dot org>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 25 Sep 2013 09:07:19 +0100
- 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> <alpine dot DEB dot 2 dot 10 dot 1309250659580 dot 4123 at laptop-mg dot saclay dot inria dot fr>
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.