From: pme Date: Mon, 4 Jun 2001 17:50:18 +0000 (+0000) Subject: 2001-06-04 Phil Edwards X-Git-Tag: upstream/4.9.2~94005 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b14e5da57c59fd64cba5cfc30634a137f0685274;p=platform%2Fupstream%2Flinaro-gcc.git 2001-06-04 Phil Edwards PR libstdc++/3034 * include/bits/stl_multiset.h (find, lower_bound, upper_bound, equal_range): Add const overloads as per LWG DR 214. * include/bits/stl_set.h: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@42862 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 361884c..8203b2e 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,6 +1,14 @@ +2001-06-04 Phil Edwards + + PR libstdc++/3034 + * include/bits/stl_multiset.h (find, lower_bound, upper_bound, + equal_range): Add const overloads as per LWG DR 214. + * include/bits/stl_set.h: Likewise. + 2001-06-04 Brendan Kehoe Phil Edwards + PR libstdc++/3018 * include/bits/std_bitset.h (bitset::test): Fix __pos >= _Nb comparison; all positions must be < _Nb. * testsuite/23_containers/bitset_members.cc: New file. diff --git a/libstdc++-v3/include/bits/stl_multiset.h b/libstdc++-v3/include/bits/stl_multiset.h index bb4e5a9..2d16985 100644 --- a/libstdc++-v3/include/bits/stl_multiset.h +++ b/libstdc++-v3/include/bits/stl_multiset.h @@ -151,8 +151,32 @@ public: // multiset operations: - iterator find(const key_type& __x) const { return _M_t.find(__x); } size_type count(const key_type& __x) const { return _M_t.count(__x); } + +#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS +//214. set::find() missing const overload + iterator find(const key_type& __x) { return _M_t.find(__x); } + const_iterator find(const key_type& __x) const { return _M_t.find(__x); } + iterator lower_bound(const key_type& __x) { + return _M_t.lower_bound(__x); + } + const_iterator lower_bound(const key_type& __x) const { + return _M_t.lower_bound(__x); + } + iterator upper_bound(const key_type& __x) { + return _M_t.upper_bound(__x); + } + const_iterator upper_bound(const key_type& __x) const { + return _M_t.upper_bound(__x); + } + pair equal_range(const key_type& __x) { + return _M_t.equal_range(__x); + } + pair equal_range(const key_type& __x) const { + return _M_t.equal_range(__x); + } +#else + iterator find(const key_type& __x) const { return _M_t.find(__x); } iterator lower_bound(const key_type& __x) const { return _M_t.lower_bound(__x); } @@ -162,6 +186,7 @@ public: pair equal_range(const key_type& __x) const { return _M_t.equal_range(__x); } +#endif template friend bool operator== (const multiset<_K1,_C1,_A1>&, diff --git a/libstdc++-v3/include/bits/stl_set.h b/libstdc++-v3/include/bits/stl_set.h index 3cfffb4..13dca9f 100644 --- a/libstdc++-v3/include/bits/stl_set.h +++ b/libstdc++-v3/include/bits/stl_set.h @@ -148,10 +148,34 @@ public: // set operations: - iterator find(const key_type& __x) const { return _M_t.find(__x); } size_type count(const key_type& __x) const { return _M_t.find(__x) == _M_t.end() ? 0 : 1; } + +#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS +//214. set::find() missing const overload + iterator find(const key_type& __x) { return _M_t.find(__x); } + const_iterator find(const key_type& __x) const { return _M_t.find(__x); } + iterator lower_bound(const key_type& __x) { + return _M_t.lower_bound(__x); + } + const_iterator lower_bound(const key_type& __x) const { + return _M_t.lower_bound(__x); + } + iterator upper_bound(const key_type& __x) { + return _M_t.upper_bound(__x); + } + const_iterator upper_bound(const key_type& __x) const { + return _M_t.upper_bound(__x); + } + pair equal_range(const key_type& __x) { + return _M_t.equal_range(__x); + } + pair equal_range(const key_type& __x) const { + return _M_t.equal_range(__x); + } +#else + iterator find(const key_type& __x) const { return _M_t.find(__x); } iterator lower_bound(const key_type& __x) const { return _M_t.lower_bound(__x); } @@ -161,6 +185,7 @@ public: pair equal_range(const key_type& __x) const { return _M_t.equal_range(__x); } +#endif template friend bool operator== (const set<_K1,_C1,_A1>&, const set<_K1,_C1,_A1>&);