From 2f039722d079d4f6cc060e3b9da0e9ba39d65478 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Dumont?= Date: Tue, 9 Oct 2018 20:38:06 +0000 Subject: [PATCH] =?UTF-8?q?2018-10-09=20=20Fran=C3=A7ois=20Dumont=20=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * include/bits/stl_list.h (_List_operator<>::operator==): Replace member function with inline friend. (_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. From-SVN: r264993 --- libstdc++-v3/ChangeLog | 13 ++++++++++ libstdc++-v3/include/bits/stl_list.h | 36 ++++++++++------------------ 2 files changed, 25 insertions(+), 24 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 114a2ffb66c..5b0880fe62f 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,16 @@ +2018-10-09 François Dumont + + * include/bits/stl_list.h + (_List_operator<>::operator==): Replace member function with inline + friend. + (_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. + 2018-10-09 Jonathan Wakely * include/bits/stringfwd.h (string, wstring, u16string, u32string): diff --git a/libstdc++-v3/include/bits/stl_list.h b/libstdc++-v3/include/bits/stl_list.h index 47749142e0e..3544981698c 100644 --- a/libstdc++-v3/include/bits/stl_list.h +++ b/libstdc++-v3/include/bits/stl_list.h @@ -243,13 +243,13 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER return __tmp; } - bool - operator==(const _Self& __x) const _GLIBCXX_NOEXCEPT - { return _M_node == __x._M_node; } + friend bool + operator==(const _Self& __x, const _Self& __y) _GLIBCXX_NOEXCEPT + { return __x._M_node == __y._M_node; } - bool - operator!=(const _Self& __x) const _GLIBCXX_NOEXCEPT - { return _M_node != __x._M_node; } + friend bool + operator!=(const _Self& __x, const _Self& __y) _GLIBCXX_NOEXCEPT + { return __x._M_node != __y._M_node; } // The only member points to the %list element. __detail::_List_node_base* _M_node; @@ -327,30 +327,18 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER return __tmp; } - bool - operator==(const _Self& __x) const _GLIBCXX_NOEXCEPT - { return _M_node == __x._M_node; } + friend bool + operator==(const _Self& __x, const _Self& __y) _GLIBCXX_NOEXCEPT + { return __x._M_node == __y._M_node; } - bool - operator!=(const _Self& __x) const _GLIBCXX_NOEXCEPT - { return _M_node != __x._M_node; } + friend bool + operator!=(const _Self& __x, const _Self& __y) _GLIBCXX_NOEXCEPT + { return __x._M_node != __y._M_node; } // The only member points to the %list element. const __detail::_List_node_base* _M_node; }; - template - inline bool - operator==(const _List_iterator<_Val>& __x, - const _List_const_iterator<_Val>& __y) _GLIBCXX_NOEXCEPT - { return __x._M_node == __y._M_node; } - - template - inline bool - operator!=(const _List_iterator<_Val>& __x, - const _List_const_iterator<_Val>& __y) _GLIBCXX_NOEXCEPT - { return __x._M_node != __y._M_node; } - _GLIBCXX_BEGIN_NAMESPACE_CXX11 /// See bits/stl_deque.h's _Deque_base for an explanation. template