+2007-10-07 Chris Jefferson <chris@bubblescope.net>
+ Paolo Carlini <pcarlini@suse.de>
+
+ * include/debug/list (list<>::list(list&&),
+ list<>::operator=(list&&)): Add.
+ (list<>::swap): Adjust.
+ (swap(list&&, list& __y), swap(list&, list&& __y)): Add.
+ * include/debug/vector (vector<>::vector(vector&&),
+ vector<>::operator=(vector&&)): Add.
+ (vector<>::swap): Adjust.
+ (swap(vector&&, vector& __y), swap(vector&, vector&& __y)): Add.
+ * include/debug/deque (deque<>::deque(deque&&),
+ deque<>::operator=(deque&&)): Add.
+ (deque<>::swap): Adjust.
+ (swap(deque&&, deque& __y), swap(deque&, deque&& __y)): Add.
+ * include/debug/set.h (set<>::set(set&&),
+ set<>::operator=(set&&)): Add.
+ (set<>::swap): Adjust.
+ (swap(set&&, set& __y), swap(set&, set&& __y)): Add.
+ * include/debug/map.h (map<>::map(map&&),
+ map<>::operator=(map&&)): Add.
+ (map<>::swap): Adjust.
+ (swap(map&&, map& __y), swap(map&, map&& __y)): Add.
+ * include/debug/multiset.h (multiset<>::multiset(multiset&&),
+ multiset<>::operator=(multiset&&)): Add.
+ (smultiet<>::swap): Adjust.
+ (swap(multiset&&, multiset& __y),
+ swap(multiset&, multiset&& __y)): Add.
+ * include/debug/multimap.h (multimap<>::multimap(multimap&&),
+ multimap<>::operator=(multimap&&)): Add.
+ (multimap<>::swap): Adjust.
+ (swap(multimap&&, multimap& __y),
+ swap(multimap&, multimap&& __y)): Add.
+
2007-10-07 Paolo Carlini <pcarlini@suse.de>
* include/bits/stl_algobase.h (_GLIBCXX_MOVE): Add.
// Debugging deque implementation -*- C++ -*-
-// Copyright (C) 2003, 2004, 2005
+// Copyright (C) 2003, 2004, 2005, 2006, 2007
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
: _Base(__gnu_debug::__check_valid_range(__first, __last), __last, __a)
{ }
- deque(const deque<_Tp,_Allocator>& __x) : _Base(__x), _Safe_base() { }
+ deque(const deque& __x)
+ : _Base(__x), _Safe_base() { }
- deque(const _Base& __x) : _Base(__x), _Safe_base() { }
+ deque(const _Base& __x)
+ : _Base(__x), _Safe_base() { }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ deque(deque&& __x)
+ : _Base(__x), _Safe_base()
+ { this->_M_swap(__x); }
+#endif
~deque() { }
- deque<_Tp,_Allocator>&
- operator=(const deque<_Tp,_Allocator>& __x)
+ deque&
+ operator=(const deque& __x)
{
*static_cast<_Base*>(this) = __x;
this->_M_invalidate_all();
return *this;
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ deque&
+ operator=(deque&& __x)
+ {
+ swap(__x);
+ return *this;
+ }
+#endif
+
template<class _InputIterator>
void
assign(_InputIterator __first, _InputIterator __last)
}
void
- swap(deque<_Tp,_Allocator>& __x)
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ swap(deque&& __x)
+#else
+ swap(deque& __x)
+#endif
{
_Base::swap(__x);
this->_M_swap(__x);
template<typename _Tp, typename _Alloc>
inline bool
- operator<(const deque<_Tp, _Alloc>& __lhs, const deque<_Tp, _Alloc>& __rhs)
+ operator<(const deque<_Tp, _Alloc>& __lhs,
+ const deque<_Tp, _Alloc>& __rhs)
{ return __lhs._M_base() < __rhs._M_base(); }
template<typename _Tp, typename _Alloc>
template<typename _Tp, typename _Alloc>
inline bool
- operator>(const deque<_Tp, _Alloc>& __lhs, const deque<_Tp, _Alloc>& __rhs)
+ operator>(const deque<_Tp, _Alloc>& __lhs,
+ const deque<_Tp, _Alloc>& __rhs)
{ return __lhs._M_base() > __rhs._M_base(); }
template<typename _Tp, typename _Alloc>
inline void
swap(deque<_Tp, _Alloc>& __lhs, deque<_Tp, _Alloc>& __rhs)
{ __lhs.swap(__rhs); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Tp, typename _Alloc>
+ inline void
+ swap(deque<_Tp, _Alloc>&& __lhs, deque<_Tp, _Alloc>& __rhs)
+ { __lhs.swap(__rhs); }
+
+ template<typename _Tp, typename _Alloc>
+ inline void
+ swap(deque<_Tp, _Alloc>& __lhs, deque<_Tp, _Alloc>&& __rhs)
+ { __lhs.swap(__rhs); }
+#endif
+
} // namespace __debug
} // namespace std
// Debugging list implementation -*- C++ -*-
-// Copyright (C) 2003, 2004, 2005, 2006
+// Copyright (C) 2003, 2004, 2005, 2006, 2007
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
{ }
- list(const list& __x) : _Base(__x), _Safe_base() { }
+ list(const list& __x)
+ : _Base(__x), _Safe_base() { }
- list(const _Base& __x) : _Base(__x), _Safe_base() { }
+ list(const _Base& __x)
+ : _Base(__x), _Safe_base() { }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ list(list&& __x)
+ : _Base(__x), _Safe_base()
+ { this->_M_swap(__x); }
+#endif
~list() { }
return *this;
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ list&
+ operator=(list&& __x)
+ {
+ swap(__x);
+ return *this;
+ }
+#endif
+
template<class _InputIterator>
void
assign(_InputIterator __first, _InputIterator __last)
}
void
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ swap(list&& __x)
+#else
swap(list& __x)
+#endif
{
_Base::swap(__x);
this->_M_swap(__x);
template<typename _Tp, typename _Alloc>
inline bool
- operator==(const list<_Tp, _Alloc>& __lhs, const list<_Tp, _Alloc>& __rhs)
+ operator==(const list<_Tp, _Alloc>& __lhs,
+ const list<_Tp, _Alloc>& __rhs)
{ return __lhs._M_base() == __rhs._M_base(); }
template<typename _Tp, typename _Alloc>
inline bool
- operator!=(const list<_Tp, _Alloc>& __lhs, const list<_Tp, _Alloc>& __rhs)
+ operator!=(const list<_Tp, _Alloc>& __lhs,
+ const list<_Tp, _Alloc>& __rhs)
{ return __lhs._M_base() != __rhs._M_base(); }
template<typename _Tp, typename _Alloc>
inline bool
- operator<(const list<_Tp, _Alloc>& __lhs, const list<_Tp, _Alloc>& __rhs)
+ operator<(const list<_Tp, _Alloc>& __lhs,
+ const list<_Tp, _Alloc>& __rhs)
{ return __lhs._M_base() < __rhs._M_base(); }
template<typename _Tp, typename _Alloc>
inline bool
- operator<=(const list<_Tp, _Alloc>& __lhs, const list<_Tp, _Alloc>& __rhs)
+ operator<=(const list<_Tp, _Alloc>& __lhs,
+ const list<_Tp, _Alloc>& __rhs)
{ return __lhs._M_base() <= __rhs._M_base(); }
template<typename _Tp, typename _Alloc>
inline bool
- operator>=(const list<_Tp, _Alloc>& __lhs, const list<_Tp, _Alloc>& __rhs)
+ operator>=(const list<_Tp, _Alloc>& __lhs,
+ const list<_Tp, _Alloc>& __rhs)
{ return __lhs._M_base() >= __rhs._M_base(); }
template<typename _Tp, typename _Alloc>
inline bool
- operator>(const list<_Tp, _Alloc>& __lhs, const list<_Tp, _Alloc>& __rhs)
+ operator>(const list<_Tp, _Alloc>& __lhs,
+ const list<_Tp, _Alloc>& __rhs)
{ return __lhs._M_base() > __rhs._M_base(); }
template<typename _Tp, typename _Alloc>
inline void
swap(list<_Tp, _Alloc>& __lhs, list<_Tp, _Alloc>& __rhs)
{ __lhs.swap(__rhs); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Tp, typename _Alloc>
+ inline void
+ swap(list<_Tp, _Alloc>&& __lhs, list<_Tp, _Alloc>& __rhs)
+ { __lhs.swap(__rhs); }
+
+ template<typename _Tp, typename _Alloc>
+ inline void
+ swap(list<_Tp, _Alloc>& __lhs, list<_Tp, _Alloc>&& __rhs)
+ { __lhs.swap(__rhs); }
+#endif
+
} // namespace __debug
} // namespace std
// Debugging map implementation -*- C++ -*-
-// Copyright (C) 2003, 2004, 2005
+// Copyright (C) 2003, 2004, 2005, 2006, 2007
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
: _Base(__gnu_debug::__check_valid_range(__first, __last), __last,
__comp, __a), _Safe_base() { }
- map(const map<_Key,_Tp,_Compare,_Allocator>& __x)
+ map(const map& __x)
: _Base(__x), _Safe_base() { }
- map(const _Base& __x) : _Base(__x), _Safe_base() { }
+ map(const _Base& __x)
+ : _Base(__x), _Safe_base() { }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ map(map&& __x)
+ : _Base(__x), _Safe_base()
+ { this->_M_swap(__x); }
+#endif
~map() { }
- map<_Key,_Tp,_Compare,_Allocator>&
- operator=(const map<_Key,_Tp,_Compare,_Allocator>& __x)
+ map&
+ operator=(const map& __x)
{
*static_cast<_Base*>(this) = __x;
this->_M_invalidate_all();
return *this;
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ map&
+ operator=(map&& __x)
+ {
+ swap(__x);
+ return *this;
+ }
+#endif
+
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 133. map missing get_allocator()
using _Base::get_allocator;
}
void
- swap(map<_Key,_Tp,_Compare,_Allocator>& __x)
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ swap(map&& __x)
+#else
+ swap(map& __x)
+#endif
{
_Base::swap(__x);
this->_M_swap(__x);
}
};
- template<typename _Key,typename _Tp,typename _Compare,typename _Allocator>
+ template<typename _Key, typename _Tp,
+ typename _Compare, typename _Allocator>
inline bool
- operator==(const map<_Key,_Tp,_Compare,_Allocator>& __lhs,
- const map<_Key,_Tp,_Compare,_Allocator>& __rhs)
+ operator==(const map<_Key, _Tp, _Compare, _Allocator>& __lhs,
+ const map<_Key, _Tp, _Compare, _Allocator>& __rhs)
{ return __lhs._M_base() == __rhs._M_base(); }
- template<typename _Key,typename _Tp,typename _Compare,typename _Allocator>
+ template<typename _Key, typename _Tp,
+ typename _Compare, typename _Allocator>
inline bool
- operator!=(const map<_Key,_Tp,_Compare,_Allocator>& __lhs,
- const map<_Key,_Tp,_Compare,_Allocator>& __rhs)
+ operator!=(const map<_Key, _Tp, _Compare, _Allocator>& __lhs,
+ const map<_Key, _Tp, _Compare, _Allocator>& __rhs)
{ return __lhs._M_base() != __rhs._M_base(); }
- template<typename _Key,typename _Tp,typename _Compare,typename _Allocator>
+ template<typename _Key, typename _Tp,
+ typename _Compare, typename _Allocator>
inline bool
- operator<(const map<_Key,_Tp,_Compare,_Allocator>& __lhs,
- const map<_Key,_Tp,_Compare,_Allocator>& __rhs)
+ operator<(const map<_Key, _Tp, _Compare, _Allocator>& __lhs,
+ const map<_Key, _Tp, _Compare, _Allocator>& __rhs)
{ return __lhs._M_base() < __rhs._M_base(); }
- template<typename _Key,typename _Tp,typename _Compare,typename _Allocator>
+ template<typename _Key, typename _Tp,
+ typename _Compare, typename _Allocator>
inline bool
- operator<=(const map<_Key,_Tp,_Compare,_Allocator>& __lhs,
- const map<_Key,_Tp,_Compare,_Allocator>& __rhs)
+ operator<=(const map<_Key, _Tp, _Compare, _Allocator>& __lhs,
+ const map<_Key, _Tp, _Compare, _Allocator>& __rhs)
{ return __lhs._M_base() <= __rhs._M_base(); }
- template<typename _Key,typename _Tp,typename _Compare,typename _Allocator>
+ template<typename _Key, typename _Tp,
+ typename _Compare, typename _Allocator>
inline bool
- operator>=(const map<_Key,_Tp,_Compare,_Allocator>& __lhs,
- const map<_Key,_Tp,_Compare,_Allocator>& __rhs)
+ operator>=(const map<_Key, _Tp, _Compare, _Allocator>& __lhs,
+ const map<_Key, _Tp, _Compare, _Allocator>& __rhs)
{ return __lhs._M_base() >= __rhs._M_base(); }
- template<typename _Key,typename _Tp,typename _Compare,typename _Allocator>
+ template<typename _Key, typename _Tp,
+ typename _Compare, typename _Allocator>
inline bool
- operator>(const map<_Key,_Tp,_Compare,_Allocator>& __lhs,
- const map<_Key,_Tp,_Compare,_Allocator>& __rhs)
+ operator>(const map<_Key, _Tp, _Compare, _Allocator>& __lhs,
+ const map<_Key, _Tp, _Compare, _Allocator>& __rhs)
{ return __lhs._M_base() > __rhs._M_base(); }
- template<typename _Key,typename _Tp,typename _Compare,typename _Allocator>
+ template<typename _Key, typename _Tp,
+ typename _Compare, typename _Allocator>
inline void
- swap(map<_Key,_Tp,_Compare,_Allocator>& __lhs,
- map<_Key,_Tp,_Compare,_Allocator>& __rhs)
+ swap(map<_Key, _Tp, _Compare, _Allocator>& __lhs,
+ map<_Key, _Tp, _Compare, _Allocator>& __rhs)
{ __lhs.swap(__rhs); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Key, typename _Tp,
+ typename _Compare, typename _Allocator>
+ inline void
+ swap(map<_Key, _Tp, _Compare, _Allocator>&& __lhs,
+ map<_Key, _Tp, _Compare, _Allocator>& __rhs)
+ { __lhs.swap(__rhs); }
+
+ template<typename _Key, typename _Tp,
+ typename _Compare, typename _Allocator>
+ inline void
+ swap(map<_Key, _Tp, _Compare, _Allocator>& __lhs,
+ map<_Key, _Tp, _Compare, _Allocator>&& __rhs)
+ { __lhs.swap(__rhs); }
+#endif
+
} // namespace __debug
} // namespace std
// Debugging multimap implementation -*- C++ -*-
-// Copyright (C) 2003, 2004, 2005
+// Copyright (C) 2003, 2004, 2005, 2006, 2007
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
typename _Allocator = std::allocator<std::pair<const _Key, _Tp> > >
class multimap
: public _GLIBCXX_STD_D::multimap<_Key, _Tp, _Compare, _Allocator>,
- public __gnu_debug::_Safe_sequence<multimap<_Key,_Tp,_Compare,_Allocator> >
+ public __gnu_debug::_Safe_sequence<multimap<_Key, _Tp,
+ _Compare, _Allocator> >
{
typedef _GLIBCXX_STD_D::multimap<_Key, _Tp, _Compare, _Allocator> _Base;
typedef __gnu_debug::_Safe_sequence<multimap> _Safe_base;
: _Base(__gnu_debug::__check_valid_range(__first, __last), __last,
__comp, __a) { }
- multimap(const multimap<_Key,_Tp,_Compare,_Allocator>& __x)
+ multimap(const multimap& __x)
: _Base(__x), _Safe_base() { }
- multimap(const _Base& __x) : _Base(__x), _Safe_base() { }
+ multimap(const _Base& __x)
+ : _Base(__x), _Safe_base() { }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ multimap(multimap&& __x)
+ : _Base(__x), _Safe_base()
+ { this->_M_swap(__x); }
+#endif
~multimap() { }
- multimap<_Key,_Tp,_Compare,_Allocator>&
- operator=(const multimap<_Key,_Tp,_Compare,_Allocator>& __x)
+ multimap&
+ operator=(const multimap& __x)
{
*static_cast<_Base*>(this) = __x;
this->_M_invalidate_all();
return *this;
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ multimap&
+ operator=(multimap&& __x)
+ {
+ swap(__x);
+ return *this;
+ }
+#endif
+
using _Base::get_allocator;
// iterators:
}
void
- swap(multimap<_Key,_Tp,_Compare,_Allocator>& __x)
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ swap(multimap&& __x)
+#else
+ swap(multimap& __x)
+#endif
{
_Base::swap(__x);
this->_M_swap(__x);
}
};
- template<typename _Key,typename _Tp,typename _Compare,typename _Allocator>
+ template<typename _Key, typename _Tp,
+ typename _Compare, typename _Allocator>
inline bool
- operator==(const multimap<_Key,_Tp,_Compare,_Allocator>& __lhs,
- const multimap<_Key,_Tp,_Compare,_Allocator>& __rhs)
+ operator==(const multimap<_Key, _Tp, _Compare, _Allocator>& __lhs,
+ const multimap<_Key, _Tp, _Compare, _Allocator>& __rhs)
{ return __lhs._M_base() == __rhs._M_base(); }
- template<typename _Key,typename _Tp,typename _Compare,typename _Allocator>
+ template<typename _Key, typename _Tp,
+ typename _Compare, typename _Allocator>
inline bool
- operator!=(const multimap<_Key,_Tp,_Compare,_Allocator>& __lhs,
- const multimap<_Key,_Tp,_Compare,_Allocator>& __rhs)
+ operator!=(const multimap<_Key, _Tp, _Compare, _Allocator>& __lhs,
+ const multimap<_Key, _Tp, _Compare, _Allocator>& __rhs)
{ return __lhs._M_base() != __rhs._M_base(); }
- template<typename _Key,typename _Tp,typename _Compare,typename _Allocator>
+ template<typename _Key, typename _Tp,
+ typename _Compare, typename _Allocator>
inline bool
- operator<(const multimap<_Key,_Tp,_Compare,_Allocator>& __lhs,
- const multimap<_Key,_Tp,_Compare,_Allocator>& __rhs)
+ operator<(const multimap<_Key, _Tp, _Compare, _Allocator>& __lhs,
+ const multimap<_Key, _Tp, _Compare, _Allocator>& __rhs)
{ return __lhs._M_base() < __rhs._M_base(); }
- template<typename _Key,typename _Tp,typename _Compare,typename _Allocator>
+ template<typename _Key, typename _Tp,
+ typename _Compare, typename _Allocator>
inline bool
- operator<=(const multimap<_Key,_Tp,_Compare,_Allocator>& __lhs,
- const multimap<_Key,_Tp,_Compare,_Allocator>& __rhs)
+ operator<=(const multimap<_Key, _Tp, _Compare, _Allocator>& __lhs,
+ const multimap<_Key, _Tp, _Compare, _Allocator>& __rhs)
{ return __lhs._M_base() <= __rhs._M_base(); }
- template<typename _Key,typename _Tp,typename _Compare,typename _Allocator>
+ template<typename _Key, typename _Tp,
+ typename _Compare, typename _Allocator>
inline bool
- operator>=(const multimap<_Key,_Tp,_Compare,_Allocator>& __lhs,
- const multimap<_Key,_Tp,_Compare,_Allocator>& __rhs)
+ operator>=(const multimap<_Key, _Tp, _Compare, _Allocator>& __lhs,
+ const multimap<_Key, _Tp, _Compare, _Allocator>& __rhs)
{ return __lhs._M_base() >= __rhs._M_base(); }
- template<typename _Key,typename _Tp,typename _Compare,typename _Allocator>
+ template<typename _Key, typename _Tp,
+ typename _Compare, typename _Allocator>
inline bool
- operator>(const multimap<_Key,_Tp,_Compare,_Allocator>& __lhs,
- const multimap<_Key,_Tp,_Compare,_Allocator>& __rhs)
+ operator>(const multimap<_Key, _Tp, _Compare, _Allocator>& __lhs,
+ const multimap<_Key, _Tp, _Compare, _Allocator>& __rhs)
{ return __lhs._M_base() > __rhs._M_base(); }
- template<typename _Key,typename _Tp,typename _Compare,typename _Allocator>
+ template<typename _Key, typename _Tp,
+ typename _Compare, typename _Allocator>
inline void
- swap(multimap<_Key,_Tp,_Compare,_Allocator>& __lhs,
- multimap<_Key,_Tp,_Compare,_Allocator>& __rhs)
+ swap(multimap<_Key, _Tp, _Compare, _Allocator>& __lhs,
+ multimap<_Key, _Tp, _Compare, _Allocator>& __rhs)
{ __lhs.swap(__rhs); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Key, typename _Tp,
+ typename _Compare, typename _Allocator>
+ inline void
+ swap(multimap<_Key, _Tp, _Compare, _Allocator>&& __lhs,
+ multimap<_Key, _Tp, _Compare, _Allocator>& __rhs)
+ { __lhs.swap(__rhs); }
+
+ template<typename _Key, typename _Tp,
+ typename _Compare, typename _Allocator>
+ inline void
+ swap(multimap<_Key, _Tp, _Compare, _Allocator>& __lhs,
+ multimap<_Key, _Tp, _Compare, _Allocator>&& __rhs)
+ { __lhs.swap(__rhs); }
+#endif
+
} // namespace __debug
} // namespace std
// Debugging multiset implementation -*- C++ -*-
-// Copyright (C) 2003, 2004, 2005
+// Copyright (C) 2003, 2004, 2005, 2006, 2007
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
: _Base(__gnu_debug::__check_valid_range(__first, __last), __last,
__comp, __a) { }
- multiset(const multiset<_Key,_Compare,_Allocator>& __x)
+ multiset(const multiset& __x)
: _Base(__x), _Safe_base() { }
- multiset(const _Base& __x) : _Base(__x), _Safe_base() { }
+ multiset(const _Base& __x)
+ : _Base(__x), _Safe_base() { }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ multiset(multiset&& __x)
+ : _Base(__x), _Safe_base()
+ { this->_M_swap(__x); }
+#endif
~multiset() { }
- multiset<_Key,_Compare,_Allocator>&
- operator=(const multiset<_Key,_Compare,_Allocator>& __x)
+ multiset&
+ operator=(const multiset& __x)
{
*static_cast<_Base*>(this) = __x;
this->_M_invalidate_all();
return *this;
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ multiset&
+ operator=(multiset&& __x)
+ {
+ swap(__x);
+ return *this;
+ }
+#endif
+
using _Base::get_allocator;
// iterators:
}
void
- swap(multiset<_Key,_Compare,_Allocator>& __x)
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ swap(multiset&& __x)
+#else
+ swap(multiset& __x)
+#endif
{
_Base::swap(__x);
this->_M_swap(__x);
template<typename _Key, typename _Compare, typename _Allocator>
inline bool
- operator==(const multiset<_Key,_Compare,_Allocator>& __lhs,
- const multiset<_Key,_Compare,_Allocator>& __rhs)
+ operator==(const multiset<_Key, _Compare, _Allocator>& __lhs,
+ const multiset<_Key, _Compare, _Allocator>& __rhs)
{ return __lhs._M_base() == __rhs._M_base(); }
template<typename _Key, typename _Compare, typename _Allocator>
inline bool
- operator!=(const multiset<_Key,_Compare,_Allocator>& __lhs,
- const multiset<_Key,_Compare,_Allocator>& __rhs)
+ operator!=(const multiset<_Key, _Compare, _Allocator>& __lhs,
+ const multiset<_Key, _Compare, _Allocator>& __rhs)
{ return __lhs._M_base() != __rhs._M_base(); }
template<typename _Key, typename _Compare, typename _Allocator>
inline bool
- operator<(const multiset<_Key,_Compare,_Allocator>& __lhs,
- const multiset<_Key,_Compare,_Allocator>& __rhs)
+ operator<(const multiset<_Key, _Compare, _Allocator>& __lhs,
+ const multiset<_Key, _Compare, _Allocator>& __rhs)
{ return __lhs._M_base() < __rhs._M_base(); }
template<typename _Key, typename _Compare, typename _Allocator>
inline bool
- operator<=(const multiset<_Key,_Compare,_Allocator>& __lhs,
- const multiset<_Key,_Compare,_Allocator>& __rhs)
+ operator<=(const multiset<_Key, _Compare, _Allocator>& __lhs,
+ const multiset<_Key, _Compare, _Allocator>& __rhs)
{ return __lhs._M_base() <= __rhs._M_base(); }
template<typename _Key, typename _Compare, typename _Allocator>
inline bool
- operator>=(const multiset<_Key,_Compare,_Allocator>& __lhs,
- const multiset<_Key,_Compare,_Allocator>& __rhs)
+ operator>=(const multiset<_Key, _Compare, _Allocator>& __lhs,
+ const multiset<_Key, _Compare, _Allocator>& __rhs)
{ return __lhs._M_base() >= __rhs._M_base(); }
template<typename _Key, typename _Compare, typename _Allocator>
inline bool
- operator>(const multiset<_Key,_Compare,_Allocator>& __lhs,
- const multiset<_Key,_Compare,_Allocator>& __rhs)
+ operator>(const multiset<_Key, _Compare, _Allocator>& __lhs,
+ const multiset<_Key, _Compare, _Allocator>& __rhs)
{ return __lhs._M_base() > __rhs._M_base(); }
template<typename _Key, typename _Compare, typename _Allocator>
void
- swap(multiset<_Key,_Compare,_Allocator>& __x,
- multiset<_Key,_Compare,_Allocator>& __y)
+ swap(multiset<_Key, _Compare, _Allocator>& __x,
+ multiset<_Key, _Compare, _Allocator>& __y)
{ return __x.swap(__y); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Key, typename _Compare, typename _Allocator>
+ void
+ swap(multiset<_Key, _Compare, _Allocator>&& __x,
+ multiset<_Key, _Compare, _Allocator>& __y)
+ { return __x.swap(__y); }
+
+ template<typename _Key, typename _Compare, typename _Allocator>
+ void
+ swap(multiset<_Key, _Compare, _Allocator>& __x,
+ multiset<_Key, _Compare, _Allocator>&& __y)
+ { return __x.swap(__y); }
+#endif
+
} // namespace __debug
} // namespace std
// Debugging set implementation -*- C++ -*-
-// Copyright (C) 2003, 2004, 2005
+// Copyright (C) 2003, 2004, 2005, 2006, 2007
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
: public _GLIBCXX_STD_D::set<_Key,_Compare,_Allocator>,
public __gnu_debug::_Safe_sequence<set<_Key, _Compare, _Allocator> >
{
- typedef _GLIBCXX_STD_D::set<_Key,_Compare,_Allocator> _Base;
+ typedef _GLIBCXX_STD_D::set<_Key, _Compare, _Allocator> _Base;
typedef __gnu_debug::_Safe_sequence<set> _Safe_base;
public:
: _Base(__gnu_debug::__check_valid_range(__first, __last), __last,
__comp, __a) { }
- set(const set<_Key,_Compare,_Allocator>& __x)
+ set(const set& __x)
: _Base(__x), _Safe_base() { }
- set(const _Base& __x) : _Base(__x), _Safe_base() { }
+ set(const _Base& __x)
+ : _Base(__x), _Safe_base() { }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ set(set&& __x)
+ : _Base(__x), _Safe_base()
+ { this->_M_swap(__x); }
+#endif
~set() { }
- set<_Key,_Compare,_Allocator>&
- operator=(const set<_Key,_Compare,_Allocator>& __x)
+ set&
+ operator=(const set& __x)
{
*static_cast<_Base*>(this) = __x;
this->_M_invalidate_all();
return *this;
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ set&
+ operator=(set&& __x)
+ {
+ swap(__x);
+ return *this;
+ }
+#endif
+
using _Base::get_allocator;
// iterators:
}
void
- swap(set<_Key,_Compare,_Allocator>& __x)
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ swap(set&& __x)
+#else
+ swap(set& __x)
+#endif
{
_Base::swap(__x);
this->_M_swap(__x);
template<typename _Key, typename _Compare, typename _Allocator>
inline bool
- operator==(const set<_Key,_Compare,_Allocator>& __lhs,
- const set<_Key,_Compare,_Allocator>& __rhs)
+ operator==(const set<_Key, _Compare, _Allocator>& __lhs,
+ const set<_Key, _Compare, _Allocator>& __rhs)
{ return __lhs._M_base() == __rhs._M_base(); }
template<typename _Key, typename _Compare, typename _Allocator>
inline bool
- operator!=(const set<_Key,_Compare,_Allocator>& __lhs,
- const set<_Key,_Compare,_Allocator>& __rhs)
+ operator!=(const set<_Key, _Compare, _Allocator>& __lhs,
+ const set<_Key, _Compare, _Allocator>& __rhs)
{ return __lhs._M_base() != __rhs._M_base(); }
template<typename _Key, typename _Compare, typename _Allocator>
inline bool
- operator<(const set<_Key,_Compare,_Allocator>& __lhs,
- const set<_Key,_Compare,_Allocator>& __rhs)
+ operator<(const set<_Key, _Compare, _Allocator>& __lhs,
+ const set<_Key, _Compare, _Allocator>& __rhs)
{ return __lhs._M_base() < __rhs._M_base(); }
template<typename _Key, typename _Compare, typename _Allocator>
inline bool
- operator<=(const set<_Key,_Compare,_Allocator>& __lhs,
- const set<_Key,_Compare,_Allocator>& __rhs)
+ operator<=(const set<_Key, _Compare, _Allocator>& __lhs,
+ const set<_Key, _Compare, _Allocator>& __rhs)
{ return __lhs._M_base() <= __rhs._M_base(); }
template<typename _Key, typename _Compare, typename _Allocator>
inline bool
- operator>=(const set<_Key,_Compare,_Allocator>& __lhs,
- const set<_Key,_Compare,_Allocator>& __rhs)
+ operator>=(const set<_Key, _Compare, _Allocator>& __lhs,
+ const set<_Key, _Compare, _Allocator>& __rhs)
{ return __lhs._M_base() >= __rhs._M_base(); }
template<typename _Key, typename _Compare, typename _Allocator>
inline bool
- operator>(const set<_Key,_Compare,_Allocator>& __lhs,
- const set<_Key,_Compare,_Allocator>& __rhs)
+ operator>(const set<_Key, _Compare, _Allocator>& __lhs,
+ const set<_Key, _Compare, _Allocator>& __rhs)
{ return __lhs._M_base() > __rhs._M_base(); }
template<typename _Key, typename _Compare, typename _Allocator>
void
- swap(set<_Key,_Compare,_Allocator>& __x,
- set<_Key,_Compare,_Allocator>& __y)
+ swap(set<_Key, _Compare, _Allocator>& __x,
+ set<_Key, _Compare, _Allocator>& __y)
{ return __x.swap(__y); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Key, typename _Compare, typename _Allocator>
+ void
+ swap(set<_Key, _Compare, _Allocator>&& __x,
+ set<_Key, _Compare, _Allocator>& __y)
+ { return __x.swap(__y); }
+
+ template<typename _Key, typename _Compare, typename _Allocator>
+ void
+ swap(set<_Key, _Compare, _Allocator>& __x,
+ set<_Key, _Compare, _Allocator>&& __y)
+ { return __x.swap(__y); }
+#endif
+
} // namespace __debug
} // namespace std
// Debugging vector implementation -*- C++ -*-
-// Copyright (C) 2003, 2004, 2005
+// Copyright (C) 2003, 2004, 2005, 2006, 2007
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
_M_guaranteed_capacity(0)
{ _M_update_guaranteed_capacity(); }
- vector(const vector<_Tp,_Allocator>& __x)
+ vector(const vector& __x)
: _Base(__x), _Safe_base(), _M_guaranteed_capacity(__x.size()) { }
/// Construction from a release-mode vector
vector(const _Base& __x)
: _Base(__x), _Safe_base(), _M_guaranteed_capacity(__x.size()) { }
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ vector(vector&& __x)
+ : _Base(__x), _Safe_base(), _M_guaranteed_capacity(this->size())
+ {
+ this->_M_swap(__x);
+ __x._M_guaranteed_capacity = 0;
+ }
+#endif
+
~vector() { }
- vector<_Tp,_Allocator>&
- operator=(const vector<_Tp,_Allocator>& __x)
+ vector&
+ operator=(const vector& __x)
{
static_cast<_Base&>(*this) = __x;
this->_M_invalidate_all();
return *this;
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ vector&
+ operator=(vector&& __x)
+ {
+ swap(__x);
+ return *this;
+ }
+#endif
+
template<typename _InputIterator>
void
assign(_InputIterator __first, _InputIterator __last)
}
void
- swap(vector<_Tp,_Allocator>& __x)
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ swap(vector&& __x)
+#else
+ swap(vector& __x)
+#endif
{
_Base::swap(__x);
this->_M_swap(__x);
inline void
swap(vector<_Tp, _Alloc>& __lhs, vector<_Tp, _Alloc>& __rhs)
{ __lhs.swap(__rhs); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Tp, typename _Alloc>
+ inline void
+ swap(vector<_Tp, _Alloc>&& __lhs, vector<_Tp, _Alloc>& __rhs)
+ { __lhs.swap(__rhs); }
+
+ template<typename _Tp, typename _Alloc>
+ inline void
+ swap(vector<_Tp, _Alloc>& __lhs, vector<_Tp, _Alloc>&& __rhs)
+ { __lhs.swap(__rhs); }
+#endif
+
} // namespace __debug
} // namespace std