libstdc++
map.h
Go to the documentation of this file.
00001 // Debugging map implementation -*- C++ -*-
00002 
00003 // Copyright (C) 2003-2016 Free Software Foundation, Inc.
00004 //
00005 // This file is part of the GNU ISO C++ Library.  This library is free
00006 // software; you can redistribute it and/or modify it under the
00007 // terms of the GNU General Public License as published by the
00008 // Free Software Foundation; either version 3, or (at your option)
00009 // any later version.
00010 
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 // GNU General Public License for more details.
00015 
00016 // Under Section 7 of GPL version 3, you are granted additional
00017 // permissions described in the GCC Runtime Library Exception, version
00018 // 3.1, as published by the Free Software Foundation.
00019 
00020 // You should have received a copy of the GNU General Public License and
00021 // a copy of the GCC Runtime Library Exception along with this program;
00022 // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
00023 // <http://www.gnu.org/licenses/>.
00024 
00025 /** @file debug/map.h
00026  *  This file is a GNU debug extension to the Standard C++ Library.
00027  */
00028 
00029 #ifndef _GLIBCXX_DEBUG_MAP_H
00030 #define _GLIBCXX_DEBUG_MAP_H 1
00031 
00032 #include <debug/safe_sequence.h>
00033 #include <debug/safe_container.h>
00034 #include <debug/safe_iterator.h>
00035 #include <utility>
00036 
00037 namespace std _GLIBCXX_VISIBILITY(default)
00038 {
00039 namespace __debug
00040 {
00041   /// Class std::map with safety/checking/debug instrumentation.
00042   template<typename _Key, typename _Tp, typename _Compare = std::less<_Key>,
00043            typename _Allocator = std::allocator<std::pair<const _Key, _Tp> > >
00044     class map
00045     : public __gnu_debug::_Safe_container<
00046         map<_Key, _Tp, _Compare, _Allocator>, _Allocator,
00047         __gnu_debug::_Safe_node_sequence>,
00048       public _GLIBCXX_STD_C::map<_Key, _Tp, _Compare, _Allocator>
00049     {
00050       typedef _GLIBCXX_STD_C::map<
00051         _Key, _Tp, _Compare, _Allocator>                        _Base;
00052       typedef __gnu_debug::_Safe_container<
00053         map, _Allocator, __gnu_debug::_Safe_node_sequence>      _Safe;
00054 
00055       typedef typename _Base::const_iterator    _Base_const_iterator;
00056       typedef typename _Base::iterator          _Base_iterator;
00057       typedef __gnu_debug::_Equal_to<_Base_const_iterator> _Equal;
00058 
00059     public:
00060       // types:
00061       typedef _Key                                      key_type;
00062       typedef _Tp                                       mapped_type;
00063       typedef std::pair<const _Key, _Tp>                value_type;
00064       typedef _Compare                                  key_compare;
00065       typedef _Allocator                                allocator_type;
00066       typedef typename _Base::reference                 reference;
00067       typedef typename _Base::const_reference           const_reference;
00068 
00069       typedef __gnu_debug::_Safe_iterator<_Base_iterator, map>
00070                                                         iterator;
00071       typedef __gnu_debug::_Safe_iterator<_Base_const_iterator, map>
00072                                                         const_iterator;
00073 
00074       typedef typename _Base::size_type                 size_type;
00075       typedef typename _Base::difference_type           difference_type;
00076       typedef typename _Base::pointer                   pointer;
00077       typedef typename _Base::const_pointer             const_pointer;
00078       typedef std::reverse_iterator<iterator>           reverse_iterator;
00079       typedef std::reverse_iterator<const_iterator>     const_reverse_iterator;
00080 
00081       // 23.3.1.1 construct/copy/destroy:
00082 
00083 #if __cplusplus < 201103L
00084       map() : _Base() { }
00085 
00086       map(const map& __x)
00087       : _Base(__x) { }
00088 
00089       ~map() { }
00090 #else
00091       map() = default;
00092       map(const map&) = default;
00093       map(map&&) = default;
00094 
00095       map(initializer_list<value_type> __l,
00096           const _Compare& __c = _Compare(),
00097           const allocator_type& __a = allocator_type())
00098       : _Base(__l, __c, __a) { }
00099 
00100       explicit
00101       map(const allocator_type& __a)
00102       : _Base(__a) { }
00103 
00104       map(const map& __m, const allocator_type& __a)
00105       : _Base(__m, __a) { }
00106 
00107       map(map&& __m, const allocator_type& __a)
00108       : _Safe(std::move(__m._M_safe()), __a),
00109         _Base(std::move(__m._M_base()), __a) { }
00110 
00111       map(initializer_list<value_type> __l, const allocator_type& __a)
00112       : _Base(__l, __a) { }
00113 
00114       template<typename _InputIterator>
00115         map(_InputIterator __first, _InputIterator __last,
00116             const allocator_type& __a)
00117         : _Base(__gnu_debug::__base(__gnu_debug::__check_valid_range(__first,
00118                                                                      __last)),
00119                 __gnu_debug::__base(__last), __a)
00120         { }
00121 
00122       ~map() = default;
00123 #endif
00124 
00125       map(const _Base& __x)
00126       : _Base(__x) { }
00127 
00128       explicit map(const _Compare& __comp,
00129                    const _Allocator& __a = _Allocator())
00130       : _Base(__comp, __a) { }
00131 
00132       template<typename _InputIterator>
00133         map(_InputIterator __first, _InputIterator __last,
00134             const _Compare& __comp = _Compare(),
00135             const _Allocator& __a = _Allocator())
00136         : _Base(__gnu_debug::__base(__gnu_debug::__check_valid_range(__first,
00137                                                                      __last)),
00138                 __gnu_debug::__base(__last),
00139                 __comp, __a) { }
00140 
00141 #if __cplusplus < 201103L
00142       map&
00143       operator=(const map& __x)
00144       {
00145         this->_M_safe() = __x;
00146         _M_base() = __x;
00147         return *this;
00148       }
00149 #else
00150       map&
00151       operator=(const map&) = default;
00152 
00153       map&
00154       operator=(map&&) = default;
00155 
00156       map&
00157       operator=(initializer_list<value_type> __l)
00158       {
00159         _M_base() = __l;
00160         this->_M_invalidate_all();
00161         return *this;
00162       }
00163 #endif
00164 
00165       // _GLIBCXX_RESOLVE_LIB_DEFECTS
00166       // 133. map missing get_allocator()
00167       using _Base::get_allocator;
00168 
00169       // iterators:
00170       iterator
00171       begin() _GLIBCXX_NOEXCEPT
00172       { return iterator(_Base::begin(), this); }
00173 
00174       const_iterator
00175       begin() const _GLIBCXX_NOEXCEPT
00176       { return const_iterator(_Base::begin(), this); }
00177 
00178       iterator
00179       end() _GLIBCXX_NOEXCEPT
00180       { return iterator(_Base::end(), this); }
00181 
00182       const_iterator
00183       end() const _GLIBCXX_NOEXCEPT
00184       { return const_iterator(_Base::end(), this); }
00185 
00186       reverse_iterator
00187       rbegin() _GLIBCXX_NOEXCEPT
00188       { return reverse_iterator(end()); }
00189 
00190       const_reverse_iterator
00191       rbegin() const _GLIBCXX_NOEXCEPT
00192       { return const_reverse_iterator(end()); }
00193 
00194       reverse_iterator
00195       rend() _GLIBCXX_NOEXCEPT
00196       { return reverse_iterator(begin()); }
00197 
00198       const_reverse_iterator
00199       rend() const _GLIBCXX_NOEXCEPT
00200       { return const_reverse_iterator(begin()); }
00201 
00202 #if __cplusplus >= 201103L
00203       const_iterator
00204       cbegin() const noexcept
00205       { return const_iterator(_Base::begin(), this); }
00206 
00207       const_iterator
00208       cend() const noexcept
00209       { return const_iterator(_Base::end(), this); }
00210 
00211       const_reverse_iterator
00212       crbegin() const noexcept
00213       { return const_reverse_iterator(end()); }
00214 
00215       const_reverse_iterator
00216       crend() const noexcept
00217       { return const_reverse_iterator(begin()); }
00218 #endif
00219 
00220       // capacity:
00221       using _Base::empty;
00222       using _Base::size;
00223       using _Base::max_size;
00224 
00225       // 23.3.1.2 element access:
00226       using _Base::operator[];
00227 
00228       // _GLIBCXX_RESOLVE_LIB_DEFECTS
00229       // DR 464. Suggestion for new member functions in standard containers.
00230       using _Base::at;
00231 
00232       // modifiers:
00233 #if __cplusplus >= 201103L
00234       template<typename... _Args>
00235         std::pair<iterator, bool>
00236         emplace(_Args&&... __args)
00237         {
00238           auto __res = _Base::emplace(std::forward<_Args>(__args)...);
00239           return std::pair<iterator, bool>(iterator(__res.first, this),
00240                                            __res.second);
00241         }
00242 
00243       template<typename... _Args>
00244         iterator
00245         emplace_hint(const_iterator __pos, _Args&&... __args)
00246         {
00247           __glibcxx_check_insert(__pos);
00248           return iterator(_Base::emplace_hint(__pos.base(),
00249                                               std::forward<_Args>(__args)...),
00250                           this);
00251         }
00252 #endif
00253 
00254       std::pair<iterator, bool>
00255       insert(const value_type& __x)
00256       {
00257         std::pair<_Base_iterator, bool> __res = _Base::insert(__x);
00258         return std::pair<iterator, bool>(iterator(__res.first, this),
00259                                          __res.second);
00260       }
00261 
00262 #if __cplusplus >= 201103L
00263       template<typename _Pair, typename = typename
00264                std::enable_if<std::is_constructible<value_type,
00265                                                     _Pair&&>::value>::type>
00266         std::pair<iterator, bool>
00267         insert(_Pair&& __x)
00268         {
00269           std::pair<_Base_iterator, bool> __res
00270             = _Base::insert(std::forward<_Pair>(__x));
00271           return std::pair<iterator, bool>(iterator(__res.first, this),
00272                                            __res.second);
00273         }
00274 #endif
00275 
00276 #if __cplusplus >= 201103L
00277       void
00278       insert(std::initializer_list<value_type> __list)
00279       { _Base::insert(__list); }
00280 #endif
00281 
00282       iterator
00283 #if __cplusplus >= 201103L
00284       insert(const_iterator __position, const value_type& __x)
00285 #else
00286       insert(iterator __position, const value_type& __x)
00287 #endif
00288       {
00289         __glibcxx_check_insert(__position);
00290         return iterator(_Base::insert(__position.base(), __x), this);
00291       }
00292 
00293 #if __cplusplus >= 201103L
00294       template<typename _Pair, typename = typename
00295                std::enable_if<std::is_constructible<value_type,
00296                                                     _Pair&&>::value>::type>
00297         iterator
00298         insert(const_iterator __position, _Pair&& __x)
00299         {
00300           __glibcxx_check_insert(__position);
00301           return iterator(_Base::insert(__position.base(),
00302                                         std::forward<_Pair>(__x)), this);
00303         }
00304 #endif
00305 
00306       template<typename _InputIterator>
00307         void
00308         insert(_InputIterator __first, _InputIterator __last)
00309         {
00310           typename __gnu_debug::_Distance_traits<_InputIterator>::__type __dist;
00311           __glibcxx_check_valid_range2(__first, __last, __dist);
00312 
00313           if (__dist.second >= __gnu_debug::__dp_sign)
00314             _Base::insert(__gnu_debug::__unsafe(__first),
00315                           __gnu_debug::__unsafe(__last));
00316           else
00317             _Base::insert(__first, __last);
00318         }
00319 
00320 
00321 #if __cplusplus > 201402L
00322       template <typename... _Args>
00323         pair<iterator, bool>
00324         try_emplace(const key_type& __k, _Args&&... __args)
00325         {
00326           auto __res = _Base::try_emplace(__k,
00327                                           std::forward<_Args>(__args)...);
00328           return { iterator(__res.first, this), __res.second };
00329         }
00330 
00331       template <typename... _Args>
00332         pair<iterator, bool>
00333         try_emplace(key_type&& __k, _Args&&... __args)
00334         {
00335           auto __res = _Base::try_emplace(std::move(__k),
00336                                           std::forward<_Args>(__args)...);
00337           return { iterator(__res.first, this), __res.second };
00338         }
00339 
00340       template <typename... _Args>
00341         iterator
00342         try_emplace(const_iterator __hint, const key_type& __k,
00343                     _Args&&... __args)
00344         {
00345           __glibcxx_check_insert(__hint);
00346           return iterator(_Base::try_emplace(__hint.base(), __k,
00347                                              std::forward<_Args>(__args)...),
00348                           this);
00349         }
00350 
00351       template <typename... _Args>
00352         iterator
00353         try_emplace(const_iterator __hint, key_type&& __k, _Args&&... __args)
00354         {
00355           __glibcxx_check_insert(__hint);
00356           return iterator(_Base::try_emplace(__hint.base(), std::move(__k),
00357                                              std::forward<_Args>(__args)...),
00358                           this);
00359         }
00360 
00361       template <typename _Obj>
00362         std::pair<iterator, bool>
00363         insert_or_assign(const key_type& __k, _Obj&& __obj)
00364         {
00365           auto __res = _Base::insert_or_assign(__k,
00366                                                std::forward<_Obj>(__obj));
00367           return { iterator(__res.first, this), __res.second };
00368         }
00369 
00370       template <typename _Obj>
00371         std::pair<iterator, bool>
00372         insert_or_assign(key_type&& __k, _Obj&& __obj)
00373         {
00374           auto __res = _Base::insert_or_assign(std::move(__k),
00375                                                std::forward<_Obj>(__obj));
00376           return { iterator(__res.first, this), __res.second };
00377         }
00378 
00379       template <typename _Obj>
00380         iterator
00381         insert_or_assign(const_iterator __hint,
00382                          const key_type& __k, _Obj&& __obj)
00383         {
00384           __glibcxx_check_insert(__hint);
00385           return iterator(_Base::insert_or_assign(__hint.base(), __k,
00386                                                   std::forward<_Obj>(__obj)),
00387                           this);
00388         }
00389 
00390       template <typename _Obj>
00391         iterator
00392         insert_or_assign(const_iterator __hint, key_type&& __k, _Obj&& __obj)
00393         {
00394           __glibcxx_check_insert(__hint);
00395           return iterator(_Base::insert_or_assign(__hint.base(),
00396                                                   std::move(__k),
00397                                                   std::forward<_Obj>(__obj)),
00398                           this);
00399         }
00400 #endif
00401 
00402 
00403 #if __cplusplus >= 201103L
00404       iterator
00405       erase(const_iterator __position)
00406       {
00407         __glibcxx_check_erase(__position);
00408         this->_M_invalidate_if(_Equal(__position.base()));
00409         return iterator(_Base::erase(__position.base()), this);
00410       }
00411 
00412       iterator
00413       erase(iterator __position)
00414       { return erase(const_iterator(__position)); }
00415 #else
00416       void
00417       erase(iterator __position)
00418       {
00419         __glibcxx_check_erase(__position);
00420         this->_M_invalidate_if(_Equal(__position.base()));
00421         _Base::erase(__position.base());
00422       }
00423 #endif
00424 
00425       size_type
00426       erase(const key_type& __x)
00427       {
00428         _Base_iterator __victim = _Base::find(__x);
00429         if (__victim == _Base::end())
00430           return 0;
00431         else
00432           {
00433             this->_M_invalidate_if(_Equal(__victim));
00434             _Base::erase(__victim);
00435             return 1;
00436           }
00437       }
00438 
00439 #if __cplusplus >= 201103L
00440       iterator
00441       erase(const_iterator __first, const_iterator __last)
00442       {
00443         // _GLIBCXX_RESOLVE_LIB_DEFECTS
00444         // 151. can't currently clear() empty container
00445         __glibcxx_check_erase_range(__first, __last);
00446         for (_Base_const_iterator __victim = __first.base();
00447              __victim != __last.base(); ++__victim)
00448           {
00449             _GLIBCXX_DEBUG_VERIFY(__victim != _Base::end(),
00450                                   _M_message(__gnu_debug::__msg_valid_range)
00451                                   ._M_iterator(__first, "first")
00452                                   ._M_iterator(__last, "last"));
00453             this->_M_invalidate_if(_Equal(__victim));
00454           }
00455         return iterator(_Base::erase(__first.base(), __last.base()), this);
00456       }
00457 #else
00458       void
00459       erase(iterator __first, iterator __last)
00460       {
00461         // _GLIBCXX_RESOLVE_LIB_DEFECTS
00462         // 151. can't currently clear() empty container
00463         __glibcxx_check_erase_range(__first, __last);
00464         for (_Base_iterator __victim = __first.base();
00465              __victim != __last.base(); ++__victim)
00466           {
00467             _GLIBCXX_DEBUG_VERIFY(__victim != _Base::end(),
00468                                   _M_message(__gnu_debug::__msg_valid_range)
00469                                   ._M_iterator(__first, "first")
00470                                   ._M_iterator(__last, "last"));
00471             this->_M_invalidate_if(_Equal(__victim));
00472           }
00473         _Base::erase(__first.base(), __last.base());
00474       }
00475 #endif
00476 
00477       void
00478       swap(map& __x)
00479       _GLIBCXX_NOEXCEPT_IF( noexcept(declval<_Base&>().swap(__x)) )
00480       {
00481         _Safe::_M_swap(__x);
00482         _Base::swap(__x);
00483       }
00484 
00485       void
00486       clear() _GLIBCXX_NOEXCEPT
00487       {
00488         this->_M_invalidate_all();
00489         _Base::clear();
00490       }
00491 
00492       // observers:
00493       using _Base::key_comp;
00494       using _Base::value_comp;
00495 
00496       // 23.3.1.3 map operations:
00497       iterator
00498       find(const key_type& __x)
00499       { return iterator(_Base::find(__x), this); }
00500 
00501 #if __cplusplus > 201103L
00502       template<typename _Kt,
00503                typename _Req =
00504                  typename __has_is_transparent<_Compare, _Kt>::type>
00505         iterator
00506         find(const _Kt& __x)
00507         { return { _Base::find(__x), this }; }
00508 #endif
00509 
00510       const_iterator
00511       find(const key_type& __x) const
00512       { return const_iterator(_Base::find(__x), this); }
00513 
00514 #if __cplusplus > 201103L
00515       template<typename _Kt,
00516                typename _Req =
00517                  typename __has_is_transparent<_Compare, _Kt>::type>
00518         const_iterator
00519         find(const _Kt& __x) const
00520         { return { _Base::find(__x), this }; }
00521 #endif
00522 
00523       using _Base::count;
00524 
00525       iterator
00526       lower_bound(const key_type& __x)
00527       { return iterator(_Base::lower_bound(__x), this); }
00528 
00529 #if __cplusplus > 201103L
00530       template<typename _Kt,
00531                typename _Req =
00532                  typename __has_is_transparent<_Compare, _Kt>::type>
00533         iterator
00534         lower_bound(const _Kt& __x)
00535         { return { _Base::lower_bound(__x), this }; }
00536 #endif
00537 
00538       const_iterator
00539       lower_bound(const key_type& __x) const
00540       { return const_iterator(_Base::lower_bound(__x), this); }
00541 
00542 #if __cplusplus > 201103L
00543       template<typename _Kt,
00544                typename _Req =
00545                  typename __has_is_transparent<_Compare, _Kt>::type>
00546         const_iterator
00547         lower_bound(const _Kt& __x) const
00548         { return { _Base::lower_bound(__x), this }; }
00549 #endif
00550 
00551       iterator
00552       upper_bound(const key_type& __x)
00553       { return iterator(_Base::upper_bound(__x), this); }
00554 
00555 #if __cplusplus > 201103L
00556       template<typename _Kt,
00557                typename _Req =
00558                  typename __has_is_transparent<_Compare, _Kt>::type>
00559         iterator
00560         upper_bound(const _Kt& __x)
00561         { return { _Base::upper_bound(__x), this }; }
00562 #endif
00563 
00564       const_iterator
00565       upper_bound(const key_type& __x) const
00566       { return const_iterator(_Base::upper_bound(__x), this); }
00567 
00568 #if __cplusplus > 201103L
00569       template<typename _Kt,
00570                typename _Req =
00571                  typename __has_is_transparent<_Compare, _Kt>::type>
00572         const_iterator
00573         upper_bound(const _Kt& __x) const
00574         { return { _Base::upper_bound(__x), this }; }
00575 #endif
00576 
00577       std::pair<iterator,iterator>
00578       equal_range(const key_type& __x)
00579       {
00580         std::pair<_Base_iterator, _Base_iterator> __res =
00581         _Base::equal_range(__x);
00582         return std::make_pair(iterator(__res.first, this),
00583                               iterator(__res.second, this));
00584       }
00585 
00586 #if __cplusplus > 201103L
00587       template<typename _Kt,
00588                typename _Req =
00589                  typename __has_is_transparent<_Compare, _Kt>::type>
00590         std::pair<iterator, iterator>
00591         equal_range(const _Kt& __x)
00592         {
00593           auto __res = _Base::equal_range(__x);
00594           return { { __res.first, this }, { __res.second, this } };
00595         }
00596 #endif
00597 
00598       std::pair<const_iterator,const_iterator>
00599       equal_range(const key_type& __x) const
00600       {
00601         std::pair<_Base_const_iterator, _Base_const_iterator> __res =
00602         _Base::equal_range(__x);
00603         return std::make_pair(const_iterator(__res.first, this),
00604                               const_iterator(__res.second, this));
00605       }
00606 
00607 #if __cplusplus > 201103L
00608       template<typename _Kt,
00609                typename _Req =
00610                  typename __has_is_transparent<_Compare, _Kt>::type>
00611         std::pair<const_iterator, const_iterator>
00612         equal_range(const _Kt& __x) const
00613         {
00614           auto __res = _Base::equal_range(__x);
00615           return { { __res.first, this }, { __res.second, this } };
00616         }
00617 #endif
00618 
00619       _Base&
00620       _M_base() _GLIBCXX_NOEXCEPT       { return *this; }
00621 
00622       const _Base&
00623       _M_base() const _GLIBCXX_NOEXCEPT { return *this; }
00624     };
00625 
00626   template<typename _Key, typename _Tp,
00627            typename _Compare, typename _Allocator>
00628     inline bool
00629     operator==(const map<_Key, _Tp, _Compare, _Allocator>& __lhs,
00630                const map<_Key, _Tp, _Compare, _Allocator>& __rhs)
00631     { return __lhs._M_base() == __rhs._M_base(); }
00632 
00633   template<typename _Key, typename _Tp,
00634            typename _Compare, typename _Allocator>
00635     inline bool
00636     operator!=(const map<_Key, _Tp, _Compare, _Allocator>& __lhs,
00637                const map<_Key, _Tp, _Compare, _Allocator>& __rhs)
00638     { return __lhs._M_base() != __rhs._M_base(); }
00639 
00640   template<typename _Key, typename _Tp,
00641            typename _Compare, typename _Allocator>
00642     inline bool
00643     operator<(const map<_Key, _Tp, _Compare, _Allocator>& __lhs,
00644               const map<_Key, _Tp, _Compare, _Allocator>& __rhs)
00645     { return __lhs._M_base() < __rhs._M_base(); }
00646 
00647   template<typename _Key, typename _Tp,
00648            typename _Compare, typename _Allocator>
00649     inline bool
00650     operator<=(const map<_Key, _Tp, _Compare, _Allocator>& __lhs,
00651                const map<_Key, _Tp, _Compare, _Allocator>& __rhs)
00652     { return __lhs._M_base() <= __rhs._M_base(); }
00653 
00654   template<typename _Key, typename _Tp,
00655            typename _Compare, typename _Allocator>
00656     inline bool
00657     operator>=(const map<_Key, _Tp, _Compare, _Allocator>& __lhs,
00658                const map<_Key, _Tp, _Compare, _Allocator>& __rhs)
00659     { return __lhs._M_base() >= __rhs._M_base(); }
00660 
00661   template<typename _Key, typename _Tp,
00662            typename _Compare, typename _Allocator>
00663     inline bool
00664     operator>(const map<_Key, _Tp, _Compare, _Allocator>& __lhs,
00665               const map<_Key, _Tp, _Compare, _Allocator>& __rhs)
00666     { return __lhs._M_base() > __rhs._M_base(); }
00667 
00668   template<typename _Key, typename _Tp,
00669            typename _Compare, typename _Allocator>
00670     inline void
00671     swap(map<_Key, _Tp, _Compare, _Allocator>& __lhs,
00672          map<_Key, _Tp, _Compare, _Allocator>& __rhs)
00673     _GLIBCXX_NOEXCEPT_IF(noexcept(__lhs.swap(__rhs)))
00674     { __lhs.swap(__rhs); }
00675 
00676 } // namespace __debug
00677 } // namespace std
00678 
00679 #endif