diff options
author | Brad Garcia <bgarcia@laurelnetworks.com> | 2000-09-07 21:08:59 +0000 |
---|---|---|
committer | Benjamin Kosnik <bkoz@gcc.gnu.org> | 2000-09-07 21:08:59 +0000 |
commit | 3a664f16010a60d417017eccad4450f737e301bd (patch) | |
tree | d02e17d3f8cf6b3668c3dd41145cdd588ec787b8 | |
parent | 3eea1aed40a62c7ba810521ce76282d8964de5e2 (diff) | |
download | gcc-3a664f16010a60d417017eccad4450f737e301bd.zip gcc-3a664f16010a60d417017eccad4450f737e301bd.tar.gz gcc-3a664f16010a60d417017eccad4450f737e301bd.tar.bz2 |
stl_tree.h: Make operators !=, == type safe for map, set.
2000-09-07 Brad Garcia <bgarcia@laurelnetworks.com>
* 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
-rw-r--r-- | libstdc++-v3/ChangeLog | 7 | ||||
-rw-r--r-- | libstdc++-v3/bits/stl_tree.h | 10 |
2 files changed, 13 insertions, 4 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index c61d9ef..119f882 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,10 @@ +2000-09-07 Brad Garcia <bgarcia@laurelnetworks.com> + + * 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 <rth@cygnus.com> Benjamin Kosnik <bkoz@cygnus.com> diff --git a/libstdc++-v3/bits/stl_tree.h b/libstdc++-v3/bits/stl_tree.h index 9ab9daf..1c78fd2 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 <class _Value, class _Ref, class _Ptr> +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 <class _Value, class _Ref, class _Ptr> +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; } |