This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [PATCH] Make std::list::iterator == and != global inline friend
- From: Jonathan Wakely <jwakely at redhat dot com>
- To: François Dumont <frs dot dumont at gmail dot com>
- Cc: "libstdc++ at gcc dot gnu dot org" <libstdc++ at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 9 Oct 2018 12:31:16 +0100
- Subject: Re: [PATCH] Make std::list::iterator == and != global inline friend
- References: <b5312ca4-bbbd-8b47-22e6-168538819afc@gmail.com>
On 09/10/18 07:25 +0200, François Dumont wrote:
As we talked one day I would like to make all iterator operators
global for consistency. So here is the patch to do so for std::list
iterators.
By "global" you mean "non-member", right?
Thanks to this change the operators ==(iterator, const_iterator) and
!= are not necessary anymore, one less ==|!= operator candidate.
* include/bits/stl_list.h
(_List_operator<>::operator==): Make global inline friend.
I find this description a bit confusing. Please use "Replace member
function with inline friend" instead.
(_List_operator<>::operator!=): Likewise.
(_List_const_operator<>::operator==): Likewise.
(_List_const_operator<>::operator!=): Likewise.
(operator==(const _List_iterator<>&, const _List_const_iterator<>&)):
Remove.
(operator!=(const _List_iterator<>&, const _List_const_iterator<>&)):
Remove.
Tested under Linux x86_64.
Ok to commit ?
OK with the revised changelog text, thanks.