unordered_set.h (unordered_set<>): Prefer aggregation to inheritance with _Hashtable.

2012-10-22  François Dumont  <fdumont@gcc.gnu.org>

	* include/bits/unordered_set.h (unordered_set<>): Prefer
	aggregation to inheritance with _Hashtable.
	(unordered_multiset<>): Likewise.
	* include/debug/unordered_set (operator==): Adapt.
	* include/profile/unordered_set (operator==): Adapt.

From-SVN: r192695
This commit is contained in:
François Dumont 2012-10-22 19:53:38 +00:00
parent 9eda026ca0
commit 637fd8b3be
4 changed files with 1190 additions and 38 deletions

View File

@ -1,3 +1,11 @@
2012-10-22 François Dumont <fdumont@gcc.gnu.org>
* include/bits/unordered_set.h (unordered_set<>): Prefer
aggregation to inheritance with _Hashtable.
(unordered_multiset<>): Likewise.
* include/debug/unordered_set (operator==): Adapt.
* include/profile/unordered_set (operator==): Adapt.
2012-10-22 Yufeng Zhang <yufeng.zhang@arm.com> 2012-10-22 Yufeng Zhang <yufeng.zhang@arm.com>
Jonathan Wakely <jwakely.gcc@gmail.com> Jonathan Wakely <jwakely.gcc@gmail.com>

File diff suppressed because it is too large Load Diff

View File

@ -479,7 +479,7 @@ namespace __debug
inline bool inline bool
operator==(const unordered_set<_Value, _Hash, _Pred, _Alloc>& __x, operator==(const unordered_set<_Value, _Hash, _Pred, _Alloc>& __x,
const unordered_set<_Value, _Hash, _Pred, _Alloc>& __y) const unordered_set<_Value, _Hash, _Pred, _Alloc>& __y)
{ return __x._M_equal(__y); } { return __x._M_base() == __y._M_base(); }
template<typename _Value, typename _Hash, typename _Pred, typename _Alloc> template<typename _Value, typename _Hash, typename _Pred, typename _Alloc>
inline bool inline bool
@ -912,7 +912,7 @@ namespace __debug
inline bool inline bool
operator==(const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __x, operator==(const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __y) const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __y)
{ return __x._M_equal(__y); } { return __x._M_base() == __y._M_base(); }
template<typename _Value, typename _Hash, typename _Pred, typename _Alloc> template<typename _Value, typename _Hash, typename _Pred, typename _Alloc>
inline bool inline bool

View File

@ -50,7 +50,7 @@ namespace __profile
class unordered_set class unordered_set
: public _GLIBCXX_STD_BASE : public _GLIBCXX_STD_BASE
{ {
typedef typename _GLIBCXX_STD_BASE _Base; typedef _GLIBCXX_STD_BASE _Base;
public: public:
typedef typename _Base::size_type size_type; typedef typename _Base::size_type size_type;
@ -287,22 +287,22 @@ namespace __profile
} }
}; };
template<typename _Value, typename _Hash, typename _Pred, typename _Alloc> template<typename _Key, typename _Hash, typename _Pred, typename _Alloc>
inline void inline void
swap(unordered_set<_Value, _Hash, _Pred, _Alloc>& __x, swap(unordered_set<_Key, _Hash, _Pred, _Alloc>& __x,
unordered_set<_Value, _Hash, _Pred, _Alloc>& __y) unordered_set<_Key, _Hash, _Pred, _Alloc>& __y)
{ __x.swap(__y); } { __x.swap(__y); }
template<typename _Value, typename _Hash, typename _Pred, typename _Alloc> template<typename _Key, typename _Hash, typename _Pred, typename _Alloc>
inline bool inline bool
operator==(const unordered_set<_Value, _Hash, _Pred, _Alloc>& __x, operator==(const unordered_set<_Key, _Hash, _Pred, _Alloc>& __x,
const unordered_set<_Value, _Hash, _Pred, _Alloc>& __y) const unordered_set<_Key, _Hash, _Pred, _Alloc>& __y)
{ return __x._M_equal(__y); } { return static_cast<const _GLIBCXX_STD_BASE&>(__x) == __y; }
template<typename _Value, typename _Hash, typename _Pred, typename _Alloc> template<typename _Key, typename _Hash, typename _Pred, typename _Alloc>
inline bool inline bool
operator!=(const unordered_set<_Value, _Hash, _Pred, _Alloc>& __x, operator!=(const unordered_set<_Key, _Hash, _Pred, _Alloc>& __x,
const unordered_set<_Value, _Hash, _Pred, _Alloc>& __y) const unordered_set<_Key, _Hash, _Pred, _Alloc>& __y)
{ return !(__x == __y); } { return !(__x == __y); }
#undef _GLIBCXX_BASE #undef _GLIBCXX_BASE
@ -318,7 +318,7 @@ namespace __profile
class unordered_multiset class unordered_multiset
: public _GLIBCXX_STD_BASE : public _GLIBCXX_STD_BASE
{ {
typedef typename _GLIBCXX_STD_BASE _Base; typedef _GLIBCXX_STD_BASE _Base;
public: public:
typedef typename _Base::size_type size_type; typedef typename _Base::size_type size_type;
@ -559,7 +559,7 @@ namespace __profile
inline bool inline bool
operator==(const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __x, operator==(const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __y) const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __y)
{ return __x._M_equal(__y); } { return static_cast<const _GLIBCXX_STD_BASE&>(__x) == __y; }
template<typename _Value, typename _Hash, typename _Pred, typename _Alloc> template<typename _Value, typename _Hash, typename _Pred, typename _Alloc>
inline bool inline bool