Commit 69b3331e by Paolo Carlini Committed by Paolo Carlini

unordered_map (operator==(const unordered_map&, const unordered_map&), [...]): Remove.

2007-12-03  Paolo Carlini  <pcarlini@suse.de>

	* include/debug/unordered_map (operator==(const unordered_map&,
	const unordered_map&), operator!=(const unordered_map&,
	const unordered_map&), operator==(const unordered_multimap&,
	const unordered_multimap&), operator!=(const unordered_multimap&,
	const unordered_multimap&)): Remove.
	(unordered_map<>::unordered_map(unordered_map&&),
	operator=(unordered_map&&), clear, _M_invalidate_all,
	unordered_multimap<>::unordered_multimap(unordered_multimap&&),
	operator=(unordered_map&&), clear, _M_invalidate_all,	
	swap(unordered_map<>&&, unordered_map<>&), swap(unordered_map<>&,
	unordered_map<>&&), swap(unordered_multimap<>&&,
	unordered_multimap<>&), swap(unordered_multimap<>&,
	unordered_multimap<>&&)): Add.
	* include/debug/unordered_set (operator==(const unordered_set&,
	const unordered_set&), operator!=(const unordered_set&,
	const unordered_set&), operator==(const unordered_multiset&,
	const unordered_multiset&), operator!=(const unordered_multiset&,
	const unordered_multiset&)): Remove.
	(unordered_set<>::unordered_set(unordered_set&&),
	operator=(unordered_set&&), clear, _M_invalidate_all,
	unordered_multiset<>::unordered_multiset(unordered_multiset&&),
	operator=(unordered_set&&), clear, _M_invalidate_all,	
	swap(unordered_set<>&&, unordered_set<>&), swap(unordered_set<>&,
	unordered_set<>&&), swap(unordered_multiset<>&&,
	unordered_multiset<>&), swap(unordered_multiset<>&,
	unordered_multiset<>&&)): Add.
	* include/debug/safe_association.h (_Safe_association<>::
	_Safe_association(_Safe_association&&)): Add.
	(_Safe_association<>::clear, _M_invalidate_all): Remove.

From-SVN: r130581
parent aa1a4968
2007-12-03 Paolo Carlini <pcarlini@suse.de>
* include/debug/unordered_map (operator==(const unordered_map&,
const unordered_map&), operator!=(const unordered_map&,
const unordered_map&), operator==(const unordered_multimap&,
const unordered_multimap&), operator!=(const unordered_multimap&,
const unordered_multimap&)): Remove.
(unordered_map<>::unordered_map(unordered_map&&),
operator=(unordered_map&&), clear, _M_invalidate_all,
unordered_multimap<>::unordered_multimap(unordered_multimap&&),
operator=(unordered_map&&), clear, _M_invalidate_all,
swap(unordered_map<>&&, unordered_map<>&), swap(unordered_map<>&,
unordered_map<>&&), swap(unordered_multimap<>&&,
unordered_multimap<>&), swap(unordered_multimap<>&,
unordered_multimap<>&&)): Add.
* include/debug/unordered_set (operator==(const unordered_set&,
const unordered_set&), operator!=(const unordered_set&,
const unordered_set&), operator==(const unordered_multiset&,
const unordered_multiset&), operator!=(const unordered_multiset&,
const unordered_multiset&)): Remove.
(unordered_set<>::unordered_set(unordered_set&&),
operator=(unordered_set&&), clear, _M_invalidate_all,
unordered_multiset<>::unordered_multiset(unordered_multiset&&),
operator=(unordered_set&&), clear, _M_invalidate_all,
swap(unordered_set<>&&, unordered_set<>&), swap(unordered_set<>&,
unordered_set<>&&), swap(unordered_multiset<>&&,
unordered_multiset<>&), swap(unordered_multiset<>&,
unordered_multiset<>&&)): Add.
* include/debug/safe_association.h (_Safe_association<>::
_Safe_association(_Safe_association&&)): Add.
(_Safe_association<>::clear, _M_invalidate_all): Remove.
2007-12-01 Paolo Carlini <pcarlini@suse.de> 2007-12-01 Paolo Carlini <pcarlini@suse.de>
* include/tr1_impl/hashtable_policy.h (struct _LessThan): Remove. * include/tr1_impl/hashtable_policy.h (struct _LessThan): Remove.
......
// Safe associated container base class implementation -*- C++ -*- // Safe associated container base class implementation -*- C++ -*-
// Copyright (C) 2007 // Copyright (C) 2007 Free Software Foundation, Inc.
// Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
...@@ -108,6 +107,9 @@ namespace __gnu_debug ...@@ -108,6 +107,9 @@ namespace __gnu_debug
_Safe_association(const _Base& __x) : _Base(__x) { } _Safe_association(const _Base& __x) : _Base(__x) { }
_Safe_association(_Safe_association&& __x)
: _Base(std::forward<_Base>(__x)) { }
using _Base::size; using _Base::size;
using _Base::max_size; using _Base::max_size;
using _Base::empty; using _Base::empty;
...@@ -197,27 +199,11 @@ namespace __gnu_debug ...@@ -197,27 +199,11 @@ namespace __gnu_debug
return iterator(_Base::erase(__first.base(), __last.base())); return iterator(_Base::erase(__first.base(), __last.base()));
} }
void
clear()
{
_Base::clear();
this->_M_invalidate_all();
}
_Base& _Base&
_M_base() { return *this; } _M_base() { return *this; }
const _Base& const _Base&
_M_base() const { return *this; } _M_base() const { return *this; }
private:
void
_M_invalidate_all()
{
typedef typename _Base::const_iterator _Base_const_iterator;
typedef __gnu_debug::_Not_equal_to<_Base_const_iterator> _Not_equal;
this->_M_invalidate_if(_Not_equal(_M_base().end()));
}
}; };
} // namespace __gnu_debug } // namespace __gnu_debug
......
// Debugging unordered_map/unordered_multimap implementation -*- C++ -*- // Debugging unordered_map/unordered_multimap implementation -*- C++ -*-
// Copyright (C) 2003, 2005, 2007 // Copyright (C) 2003, 2004, 2005, 2006, 2007
// Free Software Foundation, Inc. // Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
...@@ -88,33 +88,61 @@ namespace __debug ...@@ -88,33 +88,61 @@ namespace __debug
unordered_map(const _Safe_assoc& __x) unordered_map(const _Safe_assoc& __x)
: _Safe_assoc(__x), _Safe_base() { } : _Safe_assoc(__x), _Safe_base() { }
unordered_map(unordered_map&& __x)
: _Safe_assoc(std::forward<_Safe_assoc>(__x)), _Safe_base() { }
unordered_map&
operator=(unordered_map&& __x)
{
// NB: DR 675.
clear();
swap(__x);
return *this;
}
void void
swap(unordered_map& __x) swap(unordered_map&& __x)
{ {
_Safe_assoc::swap(__x); _Safe_assoc::swap(__x);
_Safe_base::_M_swap(__x); _Safe_base::_M_swap(__x);
} }
void
clear()
{
_Base::clear();
this->_M_invalidate_all();
}
private:
void
_M_invalidate_all()
{
typedef typename _Base::const_iterator _Base_const_iterator;
typedef __gnu_debug::_Not_equal_to<_Base_const_iterator> _Not_equal;
this->_M_invalidate_if(_Not_equal(this->_M_base().end()));
}
}; };
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 void
operator==(const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x, swap(unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y) unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
{ return __x._M_base() == __y._M_base(); } { __x.swap(__y); }
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 void
operator!=(const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x, swap(unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>&& __x,
const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y) unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
{ return __x._M_base() != __y._M_base(); } { __x.swap(__y); }
template<typename _Key, typename _Tp, typename _Hash, template<typename _Key, typename _Tp, typename _Hash,
typename _Pred, typename _Alloc> typename _Pred, typename _Alloc>
inline void inline void
swap(unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x, swap(unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y) unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>&& __y)
{ __x.swap(__y); } { __x.swap(__y); }
#undef _GLIBCXX_BASE #undef _GLIBCXX_BASE
...@@ -160,36 +188,63 @@ namespace __debug ...@@ -160,36 +188,63 @@ namespace __debug
unordered_multimap(const _Safe_assoc& __x) unordered_multimap(const _Safe_assoc& __x)
: _Safe_assoc(__x), _Safe_base() { } : _Safe_assoc(__x), _Safe_base() { }
unordered_multimap(unordered_multimap&& __x)
: _Safe_assoc(std::forward<_Safe_assoc>(__x)), _Safe_base() { }
unordered_multimap&
operator=(unordered_multimap&& __x)
{
// NB: DR 675.
clear();
swap(__x);
return *this;
}
void void
swap(unordered_multimap& __x) swap(unordered_multimap&& __x)
{ {
_Safe_assoc::swap(__x); _Safe_assoc::swap(__x);
_Safe_base::_M_swap(__x); _Safe_base::_M_swap(__x);
} }
void
clear()
{
_Base::clear();
this->_M_invalidate_all();
}
private:
void
_M_invalidate_all()
{
typedef typename _Base::const_iterator _Base_const_iterator;
typedef __gnu_debug::_Not_equal_to<_Base_const_iterator> _Not_equal;
this->_M_invalidate_if(_Not_equal(this->_M_base().end()));
}
}; };
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 void
operator==(const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x, swap(unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y) unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
{ return __x._M_base() == __y._M_base(); } { __x.swap(__y); }
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 void
operator!=(const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x, swap(unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>&& __x,
const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y) unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
{ return __x._M_base() != __y._M_base(); } { __x.swap(__y); }
template<typename _Key, typename _Tp, typename _Hash, template<typename _Key, typename _Tp, typename _Hash,
typename _Pred, typename _Alloc> typename _Pred, typename _Alloc>
inline void inline void
swap(unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x, swap(unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y) unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>&& __y)
{ __x.swap(__y); } { __x.swap(__y); }
} // namespace __debug } // namespace __debug
} // namespace std } // namespace std
......
// Debugging unordered_set/unordered_multiset implementation -*- C++ -*- // Debugging unordered_set/unordered_multiset implementation -*- C++ -*-
// Copyright (C) 2003, 2005, 2007 // Copyright (C) 2003, 2004, 2005, 2006, 2007
// Free Software Foundation, Inc. // Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
...@@ -89,30 +89,58 @@ namespace __debug ...@@ -89,30 +89,58 @@ namespace __debug
unordered_set(const _Safe_assoc& __x) unordered_set(const _Safe_assoc& __x)
: _Safe_assoc(__x), _Safe_base() { } : _Safe_assoc(__x), _Safe_base() { }
unordered_set(unordered_set&& __x)
: _Safe_assoc(std::forward<_Safe_assoc>(__x)), _Safe_base() { }
unordered_set&
operator=(unordered_set&& __x)
{
// NB: DR 675.
clear();
swap(__x);
return *this;
}
void void
swap(unordered_set& __x) swap(unordered_set&& __x)
{ {
_Safe_assoc::swap(__x); _Safe_assoc::swap(__x);
_Safe_base::_M_swap(__x); _Safe_base::_M_swap(__x);
} }
void
clear()
{
_Base::clear();
this->_M_invalidate_all();
}
private:
void
_M_invalidate_all()
{
typedef typename _Base::const_iterator _Base_const_iterator;
typedef __gnu_debug::_Not_equal_to<_Base_const_iterator> _Not_equal;
this->_M_invalidate_if(_Not_equal(this->_M_base().end()));
}
}; };
template<typename _Value, typename _Hash, typename _Pred, typename _Alloc> template<typename _Value, typename _Hash, typename _Pred, typename _Alloc>
inline bool inline void
operator==(const unordered_set<_Value, _Hash, _Pred, _Alloc>& __x, swap(unordered_set<_Value, _Hash, _Pred, _Alloc>& __x,
const unordered_set<_Value, _Hash, _Pred, _Alloc>& __y) unordered_set<_Value, _Hash, _Pred, _Alloc>& __y)
{ return __x._M_base() == __y._M_base(); } { __x.swap(__y); }
template<typename _Value, typename _Hash, typename _Pred, typename _Alloc> template<typename _Value, typename _Hash, typename _Pred, typename _Alloc>
inline bool inline void
operator!=(const unordered_set<_Value, _Hash, _Pred, _Alloc>& __x, swap(unordered_set<_Value, _Hash, _Pred, _Alloc>&& __x,
const unordered_set<_Value, _Hash, _Pred, _Alloc>& __y) unordered_set<_Value, _Hash, _Pred, _Alloc>& __y)
{ return __x._M_base() != __y._M_base(); } { __x.swap(__y); }
template<typename _Value, typename _Hash, typename _Pred, typename _Alloc> template<typename _Value, typename _Hash, typename _Pred, typename _Alloc>
inline void inline void
swap(unordered_set<_Value, _Hash, _Pred, _Alloc>& __x, swap(unordered_set<_Value, _Hash, _Pred, _Alloc>& __x,
unordered_set<_Value, _Hash, _Pred, _Alloc>& __y) unordered_set<_Value, _Hash, _Pred, _Alloc>&& __y)
{ __x.swap(__y); } { __x.swap(__y); }
#undef _GLIBCXX_BASE #undef _GLIBCXX_BASE
...@@ -158,31 +186,60 @@ namespace __debug ...@@ -158,31 +186,60 @@ namespace __debug
unordered_multiset(const _Safe_assoc& __x) unordered_multiset(const _Safe_assoc& __x)
: _Safe_assoc(__x), _Safe_base() { } : _Safe_assoc(__x), _Safe_base() { }
unordered_multiset(unordered_multiset&& __x)
: _Safe_assoc(std::forward<_Safe_assoc>(__x)), _Safe_base() { }
unordered_multiset&
operator=(unordered_multiset&& __x)
{
// NB: DR 675.
clear();
swap(__x);
return *this;
}
void void
swap(unordered_multiset& __x) swap(unordered_multiset&& __x)
{ {
_Safe_assoc::swap(__x); _Safe_assoc::swap(__x);
_Safe_base::_M_swap(__x); _Safe_base::_M_swap(__x);
} }
void
clear()
{
_Base::clear();
this->_M_invalidate_all();
}
private:
void
_M_invalidate_all()
{
typedef typename _Base::const_iterator _Base_const_iterator;
typedef __gnu_debug::_Not_equal_to<_Base_const_iterator> _Not_equal;
this->_M_invalidate_if(_Not_equal(this->_M_base().end()));
}
}; };
template<typename _Value, typename _Hash, typename _Pred, typename _Alloc> template<typename _Value, typename _Hash, typename _Pred, typename _Alloc>
inline bool inline void
operator==(const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __x, swap(unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __y) unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __y)
{ return __x._M_base() == __y._M_base(); } { __x.swap(__y); }
template<typename _Value, typename _Hash, typename _Pred, typename _Alloc> template<typename _Value, typename _Hash, typename _Pred, typename _Alloc>
inline bool inline void
operator!=(const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __x, swap(unordered_multiset<_Value, _Hash, _Pred, _Alloc>&& __x,
const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __y) unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __y)
{ return __x._M_base() != __y._M_base(); } { __x.swap(__y); }
template<typename _Value, typename _Hash, typename _Pred, typename _Alloc> template<typename _Value, typename _Hash, typename _Pred, typename _Alloc>
inline void inline void
swap(unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __x, swap(unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __y) unordered_multiset<_Value, _Hash, _Pred, _Alloc>&& __y)
{ __x.swap(__y); } { __x.swap(__y); }
} // 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