Commit 7ab9c243 by Jonathan Wakely

libstdc++: Remove operator!= overloads for unordered containers

Some more C++20 changes from P1614R2, "The Mothership has Landed".

	* include/bits/unordered_map.h (unordered_map, unordered_multimap):
	Remove redundant operator!= for C++20.
	* include/bits/unordered_set.h (unordered_set, unordered_multiset):
	Likewise.
	* include/debug/unordered_map (unordered_map, unordered_multimap):
	Likewise.
	* include/debug/unordered_set (unordered_set, unordered_multiset):
	Likewise.
parent a2c0fa35
2020-04-19 Jonathan Wakely <jwakely@redhat.com> 2020-04-19 Jonathan Wakely <jwakely@redhat.com>
* include/bits/unordered_map.h (unordered_map, unordered_multimap):
Remove redundant operator!= for C++20.
* include/bits/unordered_set.h (unordered_set, unordered_multiset):
Likewise.
* include/debug/unordered_map (unordered_map, unordered_multimap):
Likewise.
* include/debug/unordered_set (unordered_set, unordered_multiset):
Likewise.
PR other/94629 PR other/94629
* include/debug/formatter.h (_Error_formatter::_Parameter): Fix * include/debug/formatter.h (_Error_formatter::_Parameter): Fix
redundant assignment in constructor. redundant assignment in constructor.
......
...@@ -2092,11 +2092,13 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -2092,11 +2092,13 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y) const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
{ return __x._M_h._M_equal(__y._M_h); } { return __x._M_h._M_equal(__y._M_h); }
#if __cpp_impl_three_way_comparison < 201907L
template<class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> template<class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
inline bool inline bool
operator!=(const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x, operator!=(const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y) const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
{ return !(__x == __y); } { return !(__x == __y); }
#endif
template<class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> template<class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
inline bool inline bool
...@@ -2104,11 +2106,13 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -2104,11 +2106,13 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y) const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
{ return __x._M_h._M_equal(__y._M_h); } { return __x._M_h._M_equal(__y._M_h); }
#if __cpp_impl_three_way_comparison < 201907L
template<class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> template<class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
inline bool inline bool
operator!=(const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x, operator!=(const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y) const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
{ return !(__x == __y); } { return !(__x == __y); }
#endif
_GLIBCXX_END_NAMESPACE_CONTAINER _GLIBCXX_END_NAMESPACE_CONTAINER
......
...@@ -1704,11 +1704,13 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -1704,11 +1704,13 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
const unordered_set<_Value, _Hash, _Pred, _Alloc>& __y) const unordered_set<_Value, _Hash, _Pred, _Alloc>& __y)
{ return __x._M_h._M_equal(__y._M_h); } { return __x._M_h._M_equal(__y._M_h); }
#if __cpp_impl_three_way_comparison < 201907L
template<class _Value, class _Hash, class _Pred, class _Alloc> template<class _Value, class _Hash, class _Pred, class _Alloc>
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 == __y); } { return !(__x == __y); }
#endif
template<class _Value, class _Hash, class _Pred, class _Alloc> template<class _Value, class _Hash, class _Pred, class _Alloc>
inline bool inline bool
...@@ -1716,11 +1718,13 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -1716,11 +1718,13 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __y) const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __y)
{ return __x._M_h._M_equal(__y._M_h); } { return __x._M_h._M_equal(__y._M_h); }
#if __cpp_impl_three_way_comparison < 201907L
template<class _Value, class _Hash, class _Pred, class _Alloc> template<class _Value, class _Hash, class _Pred, class _Alloc>
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 == __y); } { return !(__x == __y); }
#endif
_GLIBCXX_END_NAMESPACE_CONTAINER _GLIBCXX_END_NAMESPACE_CONTAINER
......
...@@ -741,13 +741,14 @@ namespace __debug ...@@ -741,13 +741,14 @@ namespace __debug
const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y) const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
{ return __x._M_base() == __y._M_base(); } { return __x._M_base() == __y._M_base(); }
#if __cpp_impl_three_way_comparison < 201907L
template<typename _Key, typename _Tp, typename _Hash, template<typename _Key, typename _Tp, typename _Hash,
typename _Pred, typename _Alloc> typename _Pred, typename _Alloc>
inline bool inline bool
operator!=(const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x, operator!=(const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y) const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
{ return !(__x == __y); } { return !(__x == __y); }
#endif
/// Class std::unordered_multimap with safety/checking/debug instrumentation. /// Class std::unordered_multimap with safety/checking/debug instrumentation.
template<typename _Key, typename _Tp, template<typename _Key, typename _Tp,
...@@ -1347,12 +1348,14 @@ namespace __debug ...@@ -1347,12 +1348,14 @@ namespace __debug
const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y) const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
{ return __x._M_base() == __y._M_base(); } { return __x._M_base() == __y._M_base(); }
#if __cpp_impl_three_way_comparison < 201907L
template<typename _Key, typename _Tp, typename _Hash, template<typename _Key, typename _Tp, typename _Hash,
typename _Pred, typename _Alloc> typename _Pred, typename _Alloc>
inline bool inline bool
operator!=(const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x, operator!=(const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y) const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
{ return !(__x == __y); } { return !(__x == __y); }
#endif
} // namespace __debug } // namespace __debug
} // namespace std } // namespace std
......
...@@ -612,12 +612,13 @@ namespace __debug ...@@ -612,12 +612,13 @@ namespace __debug
const unordered_set<_Value, _Hash, _Pred, _Alloc>& __y) const unordered_set<_Value, _Hash, _Pred, _Alloc>& __y)
{ return __x._M_base() == __y._M_base(); } { return __x._M_base() == __y._M_base(); }
#if __cpp_impl_three_way_comparison < 201907L
template<typename _Value, typename _Hash, typename _Pred, typename _Alloc> template<typename _Value, typename _Hash, typename _Pred, typename _Alloc>
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 == __y); } { return !(__x == __y); }
#endif
/// Class std::unordered_multiset with safety/checking/debug instrumentation. /// Class std::unordered_multiset with safety/checking/debug instrumentation.
template<typename _Value, template<typename _Value,
...@@ -1176,11 +1177,13 @@ namespace __debug ...@@ -1176,11 +1177,13 @@ namespace __debug
const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __y) const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __y)
{ return __x._M_base() == __y._M_base(); } { return __x._M_base() == __y._M_base(); }
#if __cpp_impl_three_way_comparison < 201907L
template<typename _Value, typename _Hash, typename _Pred, typename _Alloc> template<typename _Value, typename _Hash, typename _Pred, typename _Alloc>
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 == __y); } { return !(__x == __y); }
#endif
} // namespace __debug } // namespace __debug
} // namespace std } // namespace std
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment