This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [v3 patch] Implement N3421 - make functors greater<>
- 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: Fri, 1 Nov 2013 11:48:14 +0000
- Subject: Re: [v3 patch] Implement N3421 - make functors greater<>
- Authentication-results: sourceware.org; auth=none
- References: <CAH6eHdQtKnQozgxffB53z+EPx29Qtwk_p2h0cOrBCzdhniTM4w at mail dot gmail dot com> <alpine dot DEB dot 2 dot 10 dot 1311011218120 dot 4115 at laptop-mg dot saclay dot inria dot fr>
On 1 November 2013 11:28, Marc Glisse wrote:
> On Fri, 1 Nov 2013, Jonathan Wakely wrote:
>
>> 2013-11-01 Jonathan Wakely <jwakely.gcc@gmail.com>
>>
>> N3421 C++1y Transparent functors
>> * include/bits/stl_function.h (plus<void>, minus<void>,
>> multiplies<void>, divides<void>, modulus<void>, negate<void>,
>> equal_to<void>, not_equal_to<void>, greater<void>, less<void>,
>> greater_equal<void>, less_equal<void>, logical_and<void>,
>> logical_or<void>, logical_not<void>, bit_and<void>, bit_or<void>,
>> bit_xor<void>, bit_not<void>): Define.
>
>
> Thanks. Why use noexcept for everything except logical_not?
Oops, because the regex I used to add noexcept only matched a
trailing-return-type on a line by itself, and I missed that one. I'll
fix it now, thanks!
> I noticed recently that the following worked, it will be convenient now we
> have those functors (for my own code, not the STL):
>
> template<typename RandomAccessIterator, typename Compare = std::less<void>>
> void sort(RandomAccessIterator first, RandomAccessIterator last,
> Compare comp = {});
Nice :)