00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062 #ifndef _STL_VECTOR_H
00063 #define _STL_VECTOR_H 1
00064
00065 #include <bits/stl_iterator_base_funcs.h>
00066 #include <bits/functexcept.h>
00067 #include <bits/concept_check.h>
00068
00069 _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
00070
00071
00072 template<typename _Tp, typename _Alloc>
00073 struct _Vector_base
00074 {
00075 typedef typename _Alloc::template rebind<_Tp>::other _Tp_alloc_type;
00076
00077 struct _Vector_impl
00078 : public _Tp_alloc_type
00079 {
00080 _Tp* _M_start;
00081 _Tp* _M_finish;
00082 _Tp* _M_end_of_storage;
00083
00084 _Vector_impl()
00085 : _Tp_alloc_type(), _M_start(0), _M_finish(0), _M_end_of_storage(0)
00086 { }
00087
00088 _Vector_impl(_Tp_alloc_type const& __a)
00089 : _Tp_alloc_type(__a), _M_start(0), _M_finish(0), _M_end_of_storage(0)
00090 { }
00091 };
00092
00093 public:
00094 typedef _Alloc allocator_type;
00095
00096 _Tp_alloc_type&
00097 _M_get_Tp_allocator()
00098 { return *static_cast<_Tp_alloc_type*>(&this->_M_impl); }
00099
00100 const _Tp_alloc_type&
00101 _M_get_Tp_allocator() const
00102 { return *static_cast<const _Tp_alloc_type*>(&this->_M_impl); }
00103
00104 allocator_type
00105 get_allocator() const
00106 { return allocator_type(_M_get_Tp_allocator()); }
00107
00108 _Vector_base()
00109 : _M_impl() { }
00110
00111 _Vector_base(const allocator_type& __a)
00112 : _M_impl(__a) { }
00113
00114 _Vector_base(size_t __n, const allocator_type& __a)
00115 : _M_impl(__a)
00116 {
00117 this->_M_impl._M_start = this->_M_allocate(__n);
00118 this->_M_impl._M_finish = this->_M_impl._M_start;
00119 this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __n;
00120 }
00121
00122 #ifdef __GXX_EXPERIMENTAL_CXX0X__
00123 _Vector_base(_Vector_base&& __x)
00124 : _M_impl(__x._M_get_Tp_allocator())
00125 {
00126 this->_M_impl._M_start = __x._M_impl._M_start;
00127 this->_M_impl._M_finish = __x._M_impl._M_finish;
00128 this->_M_impl._M_end_of_storage = __x._M_impl._M_end_of_storage;
00129 __x._M_impl._M_start = 0;
00130 __x._M_impl._M_finish = 0;
00131 __x._M_impl._M_end_of_storage = 0;
00132 }
00133 #endif
00134
00135 ~_Vector_base()
00136 { _M_deallocate(this->_M_impl._M_start, this->_M_impl._M_end_of_storage
00137 - this->_M_impl._M_start); }
00138
00139 public:
00140 _Vector_impl _M_impl;
00141
00142 _Tp*
00143 _M_allocate(size_t __n)
00144 { return __n != 0 ? _M_impl.allocate(__n) : 0; }
00145
00146 void
00147 _M_deallocate(_Tp* __p, size_t __n)
00148 {
00149 if (__p)
00150 _M_impl.deallocate(__p, __n);
00151 }
00152 };
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174 template<typename _Tp, typename _Alloc = std::allocator<_Tp> >
00175 class vector : protected _Vector_base<_Tp, _Alloc>
00176 {
00177
00178 typedef typename _Alloc::value_type _Alloc_value_type;
00179 __glibcxx_class_requires(_Tp, _SGIAssignableConcept)
00180 __glibcxx_class_requires2(_Tp, _Alloc_value_type, _SameTypeConcept)
00181
00182 typedef _Vector_base<_Tp, _Alloc> _Base;
00183 typedef vector<_Tp, _Alloc> vector_type;
00184 typedef typename _Base::_Tp_alloc_type _Tp_alloc_type;
00185
00186 public:
00187 typedef _Tp value_type;
00188 typedef typename _Tp_alloc_type::pointer pointer;
00189 typedef typename _Tp_alloc_type::const_pointer const_pointer;
00190 typedef typename _Tp_alloc_type::reference reference;
00191 typedef typename _Tp_alloc_type::const_reference const_reference;
00192 typedef __gnu_cxx::__normal_iterator<pointer, vector_type> iterator;
00193 typedef __gnu_cxx::__normal_iterator<const_pointer, vector_type>
00194 const_iterator;
00195 typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
00196 typedef std::reverse_iterator<iterator> reverse_iterator;
00197 typedef size_t size_type;
00198 typedef ptrdiff_t difference_type;
00199 typedef _Alloc allocator_type;
00200
00201 protected:
00202 using _Base::_M_allocate;
00203 using _Base::_M_deallocate;
00204 using _Base::_M_impl;
00205 using _Base::_M_get_Tp_allocator;
00206
00207 public:
00208
00209
00210
00211
00212
00213 vector()
00214 : _Base() { }
00215
00216
00217
00218
00219
00220 explicit
00221 vector(const allocator_type& __a)
00222 : _Base(__a) { }
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232 explicit
00233 vector(size_type __n, const value_type& __value = value_type(),
00234 const allocator_type& __a = allocator_type())
00235 : _Base(__n, __a)
00236 { _M_fill_initialize(__n, __value); }
00237
00238
00239
00240
00241
00242
00243
00244
00245
00246
00247 vector(const vector& __x)
00248 : _Base(__x.size(), __x._M_get_Tp_allocator())
00249 { this->_M_impl._M_finish =
00250 std::__uninitialized_copy_a(__x.begin(), __x.end(),
00251 this->_M_impl._M_start,
00252 _M_get_Tp_allocator());
00253 }
00254
00255 #ifdef __GXX_EXPERIMENTAL_CXX0X__
00256
00257
00258
00259
00260
00261
00262
00263 vector(vector&& __x)
00264 : _Base(std::forward<_Base>(__x)) { }
00265 #endif
00266
00267
00268
00269
00270
00271
00272
00273
00274
00275
00276
00277
00278
00279
00280
00281
00282
00283 template<typename _InputIterator>
00284 vector(_InputIterator __first, _InputIterator __last,
00285 const allocator_type& __a = allocator_type())
00286 : _Base(__a)
00287 {
00288
00289 typedef typename std::__is_integer<_InputIterator>::__type _Integral;
00290 _M_initialize_dispatch(__first, __last, _Integral());
00291 }
00292
00293
00294
00295
00296
00297
00298
00299 ~vector()
00300 { std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
00301 _M_get_Tp_allocator()); }
00302
00303
00304
00305
00306
00307
00308
00309
00310
00311 vector&
00312 operator=(const vector& __x);
00313
00314 #ifdef __GXX_EXPERIMENTAL_CXX0X__
00315
00316
00317
00318
00319
00320
00321
00322 vector&
00323 operator=(vector&& __x)
00324 {
00325
00326 this->clear();
00327 this->swap(__x);
00328 return *this;
00329 }
00330 #endif
00331
00332
00333
00334
00335
00336
00337
00338
00339
00340
00341
00342 void
00343 assign(size_type __n, const value_type& __val)
00344 { _M_fill_assign(__n, __val); }
00345
00346
00347
00348
00349
00350
00351
00352
00353
00354
00355
00356
00357
00358 template<typename _InputIterator>
00359 void
00360 assign(_InputIterator __first, _InputIterator __last)
00361 {
00362
00363 typedef typename std::__is_integer<_InputIterator>::__type _Integral;
00364 _M_assign_dispatch(__first, __last, _Integral());
00365 }
00366
00367
00368 using _Base::get_allocator;
00369
00370
00371
00372
00373
00374
00375
00376 iterator
00377 begin()
00378 { return iterator(this->_M_impl._M_start); }
00379
00380
00381
00382
00383
00384
00385 const_iterator
00386 begin() const
00387 { return const_iterator(this->_M_impl._M_start); }
00388
00389
00390
00391
00392
00393
00394 iterator
00395 end()
00396 { return iterator(this->_M_impl._M_finish); }
00397
00398
00399
00400
00401
00402
00403 const_iterator
00404 end() const
00405 { return const_iterator(this->_M_impl._M_finish); }
00406
00407
00408
00409
00410
00411
00412 reverse_iterator
00413 rbegin()
00414 { return reverse_iterator(end()); }
00415
00416
00417
00418
00419
00420
00421 const_reverse_iterator
00422 rbegin() const
00423 { return const_reverse_iterator(end()); }
00424
00425
00426
00427
00428
00429
00430 reverse_iterator
00431 rend()
00432 { return reverse_iterator(begin()); }
00433
00434
00435
00436
00437
00438
00439 const_reverse_iterator
00440 rend() const
00441 { return const_reverse_iterator(begin()); }
00442
00443 #ifdef __GXX_EXPERIMENTAL_CXX0X__
00444
00445
00446
00447
00448
00449 const_iterator
00450 cbegin() const
00451 { return const_iterator(this->_M_impl._M_start); }
00452
00453
00454
00455
00456
00457
00458 const_iterator
00459 cend() const
00460 { return const_iterator(this->_M_impl._M_finish); }
00461
00462
00463
00464
00465
00466
00467 const_reverse_iterator
00468 crbegin() const
00469 { return const_reverse_iterator(end()); }
00470
00471
00472
00473
00474
00475
00476 const_reverse_iterator
00477 crend() const
00478 { return const_reverse_iterator(begin()); }
00479 #endif
00480
00481
00482
00483 size_type
00484 size() const
00485 { return size_type(this->_M_impl._M_finish - this->_M_impl._M_start); }
00486
00487
00488 size_type
00489 max_size() const
00490 { return _M_get_Tp_allocator().max_size(); }
00491
00492
00493
00494
00495
00496
00497
00498
00499
00500
00501
00502
00503 void
00504 resize(size_type __new_size, value_type __x = value_type())
00505 {
00506 if (__new_size < size())
00507 _M_erase_at_end(this->_M_impl._M_start + __new_size);
00508 else
00509 insert(end(), __new_size - size(), __x);
00510 }
00511
00512
00513
00514
00515
00516 size_type
00517 capacity() const
00518 { return size_type(this->_M_impl._M_end_of_storage
00519 - this->_M_impl._M_start); }
00520
00521
00522
00523
00524
00525 bool
00526 empty() const
00527 { return begin() == end(); }
00528
00529
00530
00531
00532
00533
00534
00535
00536
00537
00538
00539
00540
00541
00542
00543
00544
00545
00546 void
00547 reserve(size_type __n);
00548
00549
00550
00551
00552
00553
00554
00555
00556
00557
00558
00559
00560
00561 reference
00562 operator[](size_type __n)
00563 { return *(this->_M_impl._M_start + __n); }
00564
00565
00566
00567
00568
00569
00570
00571
00572
00573
00574
00575
00576 const_reference
00577 operator[](size_type __n) const
00578 { return *(this->_M_impl._M_start + __n); }
00579
00580 protected:
00581
00582 void
00583 _M_range_check(size_type __n) const
00584 {
00585 if (__n >= this->size())
00586 __throw_out_of_range(__N("vector::_M_range_check"));
00587 }
00588
00589 public:
00590
00591
00592
00593
00594
00595
00596
00597
00598
00599
00600
00601 reference
00602 at(size_type __n)
00603 {
00604 _M_range_check(__n);
00605 return (*this)[__n];
00606 }
00607
00608
00609
00610
00611
00612
00613
00614
00615
00616
00617
00618
00619 const_reference
00620 at(size_type __n) const
00621 {
00622 _M_range_check(__n);
00623 return (*this)[__n];
00624 }
00625
00626
00627
00628
00629
00630 reference
00631 front()
00632 { return *begin(); }
00633
00634
00635
00636
00637
00638 const_reference
00639 front() const
00640 { return *begin(); }
00641
00642
00643
00644
00645
00646 reference
00647 back()
00648 { return *(end() - 1); }
00649
00650
00651
00652
00653
00654 const_reference
00655 back() const
00656 { return *(end() - 1); }
00657
00658
00659
00660
00661
00662
00663
00664
00665 pointer
00666 data()
00667 { return pointer(this->_M_impl._M_start); }
00668
00669 const_pointer
00670 data() const
00671 { return const_pointer(this->_M_impl._M_start); }
00672
00673
00674
00675
00676
00677
00678
00679
00680
00681
00682
00683
00684 #ifndef __GXX_EXPERIMENTAL_CXX0X__
00685 void
00686 push_back(const value_type& __x)
00687 {
00688 if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage)
00689 {
00690 this->_M_impl.construct(this->_M_impl._M_finish, __x);
00691 ++this->_M_impl._M_finish;
00692 }
00693 else
00694 _M_insert_aux(end(), __x);
00695 }
00696 #else
00697 template<typename... _Args>
00698 void
00699 push_back(_Args&&... __args)
00700 {
00701 if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage)
00702 {
00703 this->_M_impl.construct(this->_M_impl._M_finish,
00704 std::forward<_Args>(__args)...);
00705 ++this->_M_impl._M_finish;
00706 }
00707 else
00708 _M_insert_aux(end(), std::forward<_Args>(__args)...);
00709 }
00710 #endif
00711
00712
00713
00714
00715
00716
00717
00718
00719
00720
00721 void
00722 pop_back()
00723 {
00724 --this->_M_impl._M_finish;
00725 this->_M_impl.destroy(this->_M_impl._M_finish);
00726 }
00727
00728 #ifdef __GXX_EXPERIMENTAL_CXX0X__
00729
00730
00731
00732
00733
00734
00735
00736
00737
00738
00739
00740
00741 template<typename... _Args>
00742 iterator
00743 emplace(iterator __position, _Args&&... __args);
00744 #endif
00745
00746
00747
00748
00749
00750
00751
00752
00753
00754
00755
00756
00757 iterator
00758 insert(iterator __position, const value_type& __x);
00759
00760 #ifdef __GXX_EXPERIMENTAL_CXX0X__
00761
00762
00763
00764
00765
00766
00767
00768
00769
00770
00771
00772 iterator
00773 insert(iterator __position, value_type&& __x)
00774 { return emplace(__position, std::move(__x)); }
00775 #endif
00776
00777
00778
00779
00780
00781
00782
00783
00784
00785
00786
00787
00788
00789
00790 void
00791 insert(iterator __position, size_type __n, const value_type& __x)
00792 { _M_fill_insert(__position, __n, __x); }
00793
00794
00795
00796
00797
00798
00799
00800
00801
00802
00803
00804
00805
00806
00807
00808 template<typename _InputIterator>
00809 void
00810 insert(iterator __position, _InputIterator __first,
00811 _InputIterator __last)
00812 {
00813
00814 typedef typename std::__is_integer<_InputIterator>::__type _Integral;
00815 _M_insert_dispatch(__position, __first, __last, _Integral());
00816 }
00817
00818
00819
00820
00821
00822
00823
00824
00825
00826
00827
00828
00829
00830
00831
00832
00833 iterator
00834 erase(iterator __position);
00835
00836
00837
00838
00839
00840
00841
00842
00843
00844
00845
00846
00847
00848
00849
00850
00851
00852
00853
00854 iterator
00855 erase(iterator __first, iterator __last);
00856
00857
00858
00859
00860
00861
00862
00863
00864
00865
00866 void
00867 #ifdef __GXX_EXPERIMENTAL_CXX0X__
00868 swap(vector&& __x)
00869 #else
00870 swap(vector& __x)
00871 #endif
00872 {
00873 std::swap(this->_M_impl._M_start, __x._M_impl._M_start);
00874 std::swap(this->_M_impl._M_finish, __x._M_impl._M_finish);
00875 std::swap(this->_M_impl._M_end_of_storage,
00876 __x._M_impl._M_end_of_storage);
00877
00878
00879
00880 std::__alloc_swap<_Tp_alloc_type>::_S_do_it(_M_get_Tp_allocator(),
00881 __x._M_get_Tp_allocator());
00882 }
00883
00884
00885
00886
00887
00888
00889
00890 void
00891 clear()
00892 { _M_erase_at_end(this->_M_impl._M_start); }
00893
00894 protected:
00895
00896
00897
00898
00899 template<typename _ForwardIterator>
00900 pointer
00901 _M_allocate_and_copy(size_type __n,
00902 _ForwardIterator __first, _ForwardIterator __last)
00903 {
00904 pointer __result = this->_M_allocate(__n);
00905 try
00906 {
00907 std::__uninitialized_copy_a(__first, __last, __result,
00908 _M_get_Tp_allocator());
00909 return __result;
00910 }
00911 catch(...)
00912 {
00913 _M_deallocate(__result, __n);
00914 __throw_exception_again;
00915 }
00916 }
00917
00918
00919
00920
00921
00922
00923
00924
00925 template<typename _Integer>
00926 void
00927 _M_initialize_dispatch(_Integer __n, _Integer __value, __true_type)
00928 {
00929 this->_M_impl._M_start = _M_allocate(static_cast<size_type>(__n));
00930 this->_M_impl._M_end_of_storage =
00931 this->_M_impl._M_start + static_cast<size_type>(__n);
00932 _M_fill_initialize(static_cast<size_type>(__n), __value);
00933 }
00934
00935
00936 template<typename _InputIterator>
00937 void
00938 _M_initialize_dispatch(_InputIterator __first, _InputIterator __last,
00939 __false_type)
00940 {
00941 typedef typename std::iterator_traits<_InputIterator>::
00942 iterator_category _IterCategory;
00943 _M_range_initialize(__first, __last, _IterCategory());
00944 }
00945
00946
00947 template<typename _InputIterator>
00948 void
00949 _M_range_initialize(_InputIterator __first,
00950 _InputIterator __last, std::input_iterator_tag)
00951 {
00952 for (; __first != __last; ++__first)
00953 push_back(*__first);
00954 }
00955
00956
00957 template<typename _ForwardIterator>
00958 void
00959 _M_range_initialize(_ForwardIterator __first,
00960 _ForwardIterator __last, std::forward_iterator_tag)
00961 {
00962 const size_type __n = std::distance(__first, __last);
00963 this->_M_impl._M_start = this->_M_allocate(__n);
00964 this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __n;
00965 this->_M_impl._M_finish =
00966 std::__uninitialized_copy_a(__first, __last,
00967 this->_M_impl._M_start,
00968 _M_get_Tp_allocator());
00969 }
00970
00971
00972
00973 void
00974 _M_fill_initialize(size_type __n, const value_type& __value)
00975 {
00976 std::__uninitialized_fill_n_a(this->_M_impl._M_start, __n, __value,
00977 _M_get_Tp_allocator());
00978 this->_M_impl._M_finish = this->_M_impl._M_end_of_storage;
00979 }
00980
00981
00982
00983
00984
00985
00986
00987
00988
00989 template<typename _Integer>
00990 void
00991 _M_assign_dispatch(_Integer __n, _Integer __val, __true_type)
00992 { _M_fill_assign(__n, __val); }
00993
00994
00995 template<typename _InputIterator>
00996 void
00997 _M_assign_dispatch(_InputIterator __first, _InputIterator __last,
00998 __false_type)
00999 {
01000 typedef typename std::iterator_traits<_InputIterator>::
01001 iterator_category _IterCategory;
01002 _M_assign_aux(__first, __last, _IterCategory());
01003 }
01004
01005
01006 template<typename _InputIterator>
01007 void
01008 _M_assign_aux(_InputIterator __first, _InputIterator __last,
01009 std::input_iterator_tag);
01010
01011
01012 template<typename _ForwardIterator>
01013 void
01014 _M_assign_aux(_ForwardIterator __first, _ForwardIterator __last,
01015 std::forward_iterator_tag);
01016
01017
01018
01019 void
01020 _M_fill_assign(size_type __n, const value_type& __val);
01021
01022
01023
01024
01025
01026
01027
01028
01029 template<typename _Integer>
01030 void
01031 _M_insert_dispatch(iterator __pos, _Integer __n, _Integer __val,
01032 __true_type)
01033 { _M_fill_insert(__pos, __n, __val); }
01034
01035
01036 template<typename _InputIterator>
01037 void
01038 _M_insert_dispatch(iterator __pos, _InputIterator __first,
01039 _InputIterator __last, __false_type)
01040 {
01041 typedef typename std::iterator_traits<_InputIterator>::
01042 iterator_category _IterCategory;
01043 _M_range_insert(__pos, __first, __last, _IterCategory());
01044 }
01045
01046
01047 template<typename _InputIterator>
01048 void
01049 _M_range_insert(iterator __pos, _InputIterator __first,
01050 _InputIterator __last, std::input_iterator_tag);
01051
01052
01053 template<typename _ForwardIterator>
01054 void
01055 _M_range_insert(iterator __pos, _ForwardIterator __first,
01056 _ForwardIterator __last, std::forward_iterator_tag);
01057
01058
01059
01060 void
01061 _M_fill_insert(iterator __pos, size_type __n, const value_type& __x);
01062
01063
01064 #ifndef __GXX_EXPERIMENTAL_CXX0X__
01065 void
01066 _M_insert_aux(iterator __position, const value_type& __x);
01067 #else
01068 template<typename... _Args>
01069 void
01070 _M_insert_aux(iterator __position, _Args&&... __args);
01071 #endif
01072
01073
01074 size_type
01075 _M_check_len(size_type __n, const char* __s) const
01076 {
01077 if (max_size() - size() < __n)
01078 __throw_length_error(__N(__s));
01079
01080 const size_type __len = size() + std::max(size(), __n);
01081 return (__len < size() || __len > max_size()) ? max_size() : __len;
01082 }
01083
01084
01085
01086
01087
01088 void
01089 _M_erase_at_end(pointer __pos)
01090 {
01091 std::_Destroy(__pos, this->_M_impl._M_finish, _M_get_Tp_allocator());
01092 this->_M_impl._M_finish = __pos;
01093 }
01094 };
01095
01096
01097
01098
01099
01100
01101
01102
01103
01104
01105
01106
01107 template<typename _Tp, typename _Alloc>
01108 inline bool
01109 operator==(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
01110 { return (__x.size() == __y.size()
01111 && std::equal(__x.begin(), __x.end(), __y.begin())); }
01112
01113
01114
01115
01116
01117
01118
01119
01120
01121
01122
01123
01124 template<typename _Tp, typename _Alloc>
01125 inline bool
01126 operator<(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
01127 { return std::lexicographical_compare(__x.begin(), __x.end(),
01128 __y.begin(), __y.end()); }
01129
01130
01131 template<typename _Tp, typename _Alloc>
01132 inline bool
01133 operator!=(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
01134 { return !(__x == __y); }
01135
01136
01137 template<typename _Tp, typename _Alloc>
01138 inline bool
01139 operator>(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
01140 { return __y < __x; }
01141
01142
01143 template<typename _Tp, typename _Alloc>
01144 inline bool
01145 operator<=(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
01146 { return !(__y < __x); }
01147
01148
01149 template<typename _Tp, typename _Alloc>
01150 inline bool
01151 operator>=(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
01152 { return !(__x < __y); }
01153
01154
01155 template<typename _Tp, typename _Alloc>
01156 inline void
01157 swap(vector<_Tp, _Alloc>& __x, vector<_Tp, _Alloc>& __y)
01158 { __x.swap(__y); }
01159
01160 #ifdef __GXX_EXPERIMENTAL_CXX0X__
01161 template<typename _Tp, typename _Alloc>
01162 inline void
01163 swap(vector<_Tp, _Alloc>&& __x, vector<_Tp, _Alloc>& __y)
01164 { __x.swap(__y); }
01165
01166 template<typename _Tp, typename _Alloc>
01167 inline void
01168 swap(vector<_Tp, _Alloc>& __x, vector<_Tp, _Alloc>&& __y)
01169 { __x.swap(__y); }
01170 #endif
01171
01172 _GLIBCXX_END_NESTED_NAMESPACE
01173
01174 #endif