From: Brad Garcia Date: Thu, 7 Sep 2000 21:08:59 +0000 (+0000) Subject: stl_tree.h: Make operators !=, == type safe for map, set. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3a664f16010a60d417017eccad4450f737e301bd;p=gcc.git stl_tree.h: Make operators !=, == type safe for map, set. 2000-09-07 Brad Garcia * bits/stl_tree.h: Make operators !=, == type safe for map, set. * testsuite/23_containers/set_operators.cc: New file. Should not compile. * testsuite/23_containers/map_operators.cc: New file. Ditto. From-SVN: r36247 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index c61d9ef196d..119f88236ad 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,10 @@ +2000-09-07 Brad Garcia + + * bits/stl_tree.h: Make operators !=, == type safe for map, set. + * testsuite/23_containers/set_operators.cc: New file. Should not + compile. + * testsuite/23_containers/map_operators.cc: New file. Ditto. + 2000-09-06 Richard Henderson Benjamin Kosnik diff --git a/libstdc++-v3/bits/stl_tree.h b/libstdc++-v3/bits/stl_tree.h index 9ab9dafcbeb..1c78fd2aa45 100644 --- a/libstdc++-v3/bits/stl_tree.h +++ b/libstdc++-v3/bits/stl_tree.h @@ -184,13 +184,15 @@ struct _Rb_tree_iterator : public _Rb_tree_base_iterator } }; -inline bool operator==(const _Rb_tree_base_iterator& __x, - const _Rb_tree_base_iterator& __y) { +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; } -inline bool operator!=(const _Rb_tree_base_iterator& __x, - const _Rb_tree_base_iterator& __y) { +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; }