+2018-10-05 François Dumont <fdumont@gcc.gnu.org>
+
+ * include/bits/stl_tree.h
+ (_Rb_tree_iterator<>::operator==): Make inline friend.
+ (_Rb_tree_iterator<>::operator!=): Likewise.
+ (_Rb_tree_const_iterator<>::operator==): Likewise.
+ (_Rb_tree_const_iterator<>::operator!=): Likewise.
+ (operator==(const _Rb_tree_iterator<>&,
+ const _Rb_tree_const_iterator&)): Remove.
+ (operator!=(const _Rb_tree_iterator<>&,
+ const _Rb_tree_const_iterator&)): Remove.
+ (operator==(const _Rb_tree<>&, const _Rb_tree<>&)): Make inline friend.
+ (operator<(const _Rb_tree<>&, const _Rb_tree<>&)): Likewise.
+ (operator!=(const _Rb_tree<>&, const _Rb_tree<>&)): Likewise and
+ deprecate.
+ (operator>(const _Rb_tree<>&, const _Rb_tree<>&)): Likewise.
+ (operator<=(const _Rb_tree<>&, const _Rb_tree<>&)): Likewise.
+ (operator>=(const _Rb_tree<>&, const _Rb_tree<>&)): Likewise.
+ * include/debug/map.h (map<>::erase(const_iterator, const_iterator)):
+ Compare __victim with _Base::cend().
+ * include/debug/multimap.h
+ (multimap<>::erase(const_iterator, const_iterator)): Likewise.
+ * include/debug/set.h (set<>::erase(const_iterator, const_iterator)):
+ Compare __victim with _Base::cend().
+ * include/debug/multiset.h
+ (multiset<>::erase(const_iterator, const_iterator)): Likewise.
+
2018-10-03 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/59439
typedef _Tp* pointer;
typedef bidirectional_iterator_tag iterator_category;
- typedef ptrdiff_t difference_type;
+ typedef ptrdiff_t difference_type;
- typedef _Rb_tree_iterator<_Tp> _Self;
- typedef _Rb_tree_node_base::_Base_ptr _Base_ptr;
- typedef _Rb_tree_node<_Tp>* _Link_type;
+ typedef _Rb_tree_iterator<_Tp> _Self;
+ typedef _Rb_tree_node_base::_Base_ptr _Base_ptr;
+ typedef _Rb_tree_node<_Tp>* _Link_type;
_Rb_tree_iterator() _GLIBCXX_NOEXCEPT
: _M_node() { }
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; }
_Base_ptr _M_node;
};
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; }
_Base_ptr _M_node;
};
- template<typename _Val>
- inline bool
- operator==(const _Rb_tree_iterator<_Val>& __x,
- const _Rb_tree_const_iterator<_Val>& __y) _GLIBCXX_NOEXCEPT
- { return __x._M_node == __y._M_node; }
-
- template<typename _Val>
- inline bool
- operator!=(const _Rb_tree_iterator<_Val>& __x,
- const _Rb_tree_const_iterator<_Val>& __y) _GLIBCXX_NOEXCEPT
- { return __x._M_node != __y._M_node; }
-
void
_Rb_tree_insert_and_rebalance(const bool __insert_left,
_Rb_tree_node_base* __x,
}
}
#endif // C++17
- };
- template<typename _Key, typename _Val, typename _KeyOfValue,
- typename _Compare, typename _Alloc>
- inline bool
- operator==(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x,
- const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __y)
- {
- return __x.size() == __y.size()
- && std::equal(__x.begin(), __x.end(), __y.begin());
- }
+ friend bool
+ operator==(const _Rb_tree& __x, const _Rb_tree& __y)
+ {
+ return __x.size() == __y.size()
+ && std::equal(__x.begin(), __x.end(), __y.begin());
+ }
- template<typename _Key, typename _Val, typename _KeyOfValue,
- typename _Compare, typename _Alloc>
- inline bool
- operator<(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x,
- const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __y)
- {
- return std::lexicographical_compare(__x.begin(), __x.end(),
- __y.begin(), __y.end());
- }
+ friend bool
+ operator<(const _Rb_tree& __x, const _Rb_tree& __y)
+ {
+ return std::lexicographical_compare(__x.begin(), __x.end(),
+ __y.begin(), __y.end());
+ }
- template<typename _Key, typename _Val, typename _KeyOfValue,
- typename _Compare, typename _Alloc>
- inline bool
- operator!=(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x,
- const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __y)
- { return !(__x == __y); }
+ friend bool _GLIBCXX_DEPRECATED
+ operator!=(const _Rb_tree& __x, const _Rb_tree& __y)
+ { return !(__x == __y); }
- template<typename _Key, typename _Val, typename _KeyOfValue,
- typename _Compare, typename _Alloc>
- inline bool
- operator>(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x,
- const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __y)
- { return __y < __x; }
+ friend bool _GLIBCXX_DEPRECATED
+ operator>(const _Rb_tree& __x, const _Rb_tree& __y)
+ { return __y < __x; }
- template<typename _Key, typename _Val, typename _KeyOfValue,
- typename _Compare, typename _Alloc>
- inline bool
- operator<=(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x,
- const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __y)
- { return !(__y < __x); }
+ friend bool _GLIBCXX_DEPRECATED
+ operator<=(const _Rb_tree& __x, const _Rb_tree& __y)
+ { return !(__y < __x); }
- template<typename _Key, typename _Val, typename _KeyOfValue,
- typename _Compare, typename _Alloc>
- inline bool
- operator>=(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x,
- const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __y)
- { return !(__x < __y); }
+ friend bool _GLIBCXX_DEPRECATED
+ operator>=(const _Rb_tree& __x, const _Rb_tree& __y)
+ { return !(__x < __y); }
+ };
template<typename _Key, typename _Val, typename _KeyOfValue,
typename _Compare, typename _Alloc>