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