From c9b6c28211cdf126b8e05c57a1ac9da148108a73 Mon Sep 17 00:00:00 2001 From: Benjamin Kosnik Date: Fri, 17 Nov 2000 22:58:19 +0000 Subject: [PATCH] stl_tree.h: Overload operators == and != to be able to handle the case... 2000-11-17 Theodore Papadopoulo * include/bits/stl_tree.h: Overload operators == and != to be able to handle the case (const_iterator,iterator) and (iterator,const_iterator), thus fixing libstdc++/737 and the like. From-SVN: r37531 --- libstdc++-v3/ChangeLog | 8 +++++++- libstdc++-v3/include/bits/stl_tree.h | 24 ++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 71197d4c0fd..af4c6975f50 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,9 @@ +2000-11-17 Theodore Papadopoulo + + * include/bits/stl_tree.h: Overload operators == and != to be able + to handle the case (const_iterator,iterator) and + (iterator,const_iterator), thus fixing libstdc++/737 and the like. + 2000-11-17 Loren J. Rittle * acinclude.m4 (GLIBCPP_ENABLE_CSTDIO): Correct last patch @@ -52,7 +58,7 @@ * config/c_io_stdio.h: Include libio.h. -Wed Nov 15 18:39:34 2000 Mark P Mitchell +2000-11-15 Mark P Mitchell * acinclude.m4 (GLIBCPP_ENABLE_CSTDIO): Substitute libio_la. * src/Makefile.am (libstdc___la_LIBADD): Use it. diff --git a/libstdc++-v3/include/bits/stl_tree.h b/libstdc++-v3/include/bits/stl_tree.h index 1c78fd2aa45..f82f21c3c07 100644 --- a/libstdc++-v3/include/bits/stl_tree.h +++ b/libstdc++-v3/include/bits/stl_tree.h @@ -190,12 +190,36 @@ inline bool operator==(const _Rb_tree_iterator<_Value, _Ref, _Ptr>& __x, return __x._M_node == __y._M_node; } +template +inline bool operator==(const _Rb_tree_iterator<_Value, const _Value&, const _Value*>& __x, + const _Rb_tree_iterator<_Value, _Value&, _Value*>& __y) { + return __x._M_node == __y._M_node; +} + +template +inline bool operator==(const _Rb_tree_iterator<_Value, _Value&, _Value*>& __x, + const _Rb_tree_iterator<_Value, const _Value&, const _Value*>& __y) { + return __x._M_node == __y._M_node; +} + template inline bool operator!=(const _Rb_tree_iterator<_Value, _Ref, _Ptr>& __x, const _Rb_tree_iterator<_Value, _Ref, _Ptr>& __y) { return __x._M_node != __y._M_node; } +template +inline bool operator!=(const _Rb_tree_iterator<_Value, const _Value&, const _Value*>& __x, + const _Rb_tree_iterator<_Value, _Value&, _Value*>& __y) { + return __x._M_node != __y._M_node; +} + +template +inline bool operator!=(const _Rb_tree_iterator<_Value, _Value&, _Value*>& __x, + const _Rb_tree_iterator<_Value, const _Value&, const _Value*>& __y) { + return __x._M_node != __y._M_node; +} + #ifndef __STL_CLASS_PARTIAL_SPECIALIZATION inline bidirectional_iterator_tag -- 2.30.2