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
00340 this->clear();
00341 this->swap(__x);
00342 return *this;
00343 }
00344
00345
00346
00347
00348
00349
00350
00351
00352
00353
00354
00355
00356 vector&
00357 operator=(initializer_list<value_type> __l)
00358 {
00359 this->assign(__l.begin(), __l.end());
00360 return *this;
00361 }
00362 #endif
00363
00364
00365
00366
00367
00368
00369
00370
00371
00372
00373
00374 void
00375 assign(size_type __n, const value_type& __val)
00376 { _M_fill_assign(__n, __val); }
00377
00378
00379
00380
00381
00382
00383
00384
00385
00386
00387
00388
00389
00390 template<typename _InputIterator>
00391 void
00392 assign(_InputIterator __first, _InputIterator __last)
00393 {
00394
00395 typedef typename std::__is_integer<_InputIterator>::__type _Integral;
00396 _M_assign_dispatch(__first, __last, _Integral());
00397 }
00398
00399 #ifdef __GXX_EXPERIMENTAL_CXX0X__
00400
00401
00402
00403
00404
00405
00406
00407
00408
00409
00410
00411 void
00412 assign(initializer_list<value_type> __l)
00413 { this->assign(__l.begin(), __l.end()); }
00414 #endif
00415
00416
00417 using _Base::get_allocator;
00418
00419
00420
00421
00422
00423
00424
00425 iterator
00426 begin()
00427 { return iterator(this->_M_impl._M_start); }
00428
00429
00430
00431
00432
00433
00434 const_iterator
00435 begin() const
00436 { return const_iterator(this->_M_impl._M_start); }
00437
00438
00439
00440
00441
00442
00443 iterator
00444 end()
00445 { return iterator(this->_M_impl._M_finish); }
00446
00447
00448
00449
00450
00451
00452 const_iterator
00453 end() const
00454 { return const_iterator(this->_M_impl._M_finish); }
00455
00456
00457
00458
00459
00460
00461 reverse_iterator
00462 rbegin()
00463 { return reverse_iterator(end()); }
00464
00465
00466
00467
00468
00469
00470 const_reverse_iterator
00471 rbegin() const
00472 { return const_reverse_iterator(end()); }
00473
00474
00475
00476
00477
00478
00479 reverse_iterator
00480 rend()
00481 { return reverse_iterator(begin()); }
00482
00483
00484
00485
00486
00487
00488 const_reverse_iterator
00489 rend() const
00490 { return const_reverse_iterator(begin()); }
00491
00492 #ifdef __GXX_EXPERIMENTAL_CXX0X__
00493
00494
00495
00496
00497
00498 const_iterator
00499 cbegin() const
00500 { return const_iterator(this->_M_impl._M_start); }
00501
00502
00503
00504
00505
00506
00507 const_iterator
00508 cend() const
00509 { return const_iterator(this->_M_impl._M_finish); }
00510
00511
00512
00513
00514
00515
00516 const_reverse_iterator
00517 crbegin() const
00518 { return const_reverse_iterator(end()); }
00519
00520
00521
00522
00523
00524
00525 const_reverse_iterator
00526 crend() const
00527 { return const_reverse_iterator(begin()); }
00528 #endif
00529
00530
00531
00532 size_type
00533 size() const
00534 { return size_type(this->_M_impl._M_finish - this->_M_impl._M_start); }
00535
00536
00537 size_type
00538 max_size() const
00539 { return _M_get_Tp_allocator().max_size(); }
00540
00541
00542
00543
00544
00545
00546
00547
00548
00549
00550
00551
00552 void
00553 resize(size_type __new_size, value_type __x = value_type())
00554 {
00555 if (__new_size < size())
00556 _M_erase_at_end(this->_M_impl._M_start + __new_size);
00557 else
00558 insert(end(), __new_size - size(), __x);
00559 }
00560
00561 #ifdef __GXX_EXPERIMENTAL_CXX0X__
00562
00563 void
00564 shrink_to_fit()
00565 { std::__shrink_to_fit<vector>::_S_do_it(*this); }
00566 #endif
00567
00568
00569
00570
00571
00572 size_type
00573 capacity() const
00574 { return size_type(this->_M_impl._M_end_of_storage
00575 - this->_M_impl._M_start); }
00576
00577
00578
00579
00580
00581 bool
00582 empty() const
00583 { return begin() == end(); }
00584
00585
00586
00587
00588
00589
00590
00591
00592
00593
00594
00595
00596
00597
00598
00599
00600
00601
00602 void
00603 reserve(size_type __n);
00604
00605
00606
00607
00608
00609
00610
00611
00612
00613
00614
00615
00616
00617 reference
00618 operator[](size_type __n)
00619 { return *(this->_M_impl._M_start + __n); }
00620
00621
00622
00623
00624
00625
00626
00627
00628
00629
00630
00631
00632 const_reference
00633 operator[](size_type __n) const
00634 { return *(this->_M_impl._M_start + __n); }
00635
00636 protected:
00637
00638 void
00639 _M_range_check(size_type __n) const
00640 {
00641 if (__n >= this->size())
00642 __throw_out_of_range(__N("vector::_M_range_check"));
00643 }
00644
00645 public:
00646
00647
00648
00649
00650
00651
00652
00653
00654
00655
00656
00657 reference
00658 at(size_type __n)
00659 {
00660 _M_range_check(__n);
00661 return (*this)[__n];
00662 }
00663
00664
00665
00666
00667
00668
00669
00670
00671
00672
00673
00674
00675 const_reference
00676 at(size_type __n) const
00677 {
00678 _M_range_check(__n);
00679 return (*this)[__n];
00680 }
00681
00682
00683
00684
00685
00686 reference
00687 front()
00688 { return *begin(); }
00689
00690
00691
00692
00693
00694 const_reference
00695 front() const
00696 { return *begin(); }
00697
00698
00699
00700
00701
00702 reference
00703 back()
00704 { return *(end() - 1); }
00705
00706
00707
00708
00709
00710 const_reference
00711 back() const
00712 { return *(end() - 1); }
00713
00714
00715
00716
00717
00718
00719
00720
00721 pointer
00722 data()
00723 { return pointer(this->_M_impl._M_start); }
00724
00725 const_pointer
00726 data() const
00727 { return const_pointer(this->_M_impl._M_start); }
00728
00729
00730
00731
00732
00733
00734
00735
00736
00737
00738
00739
00740 void
00741 push_back(const value_type& __x)
00742 {
00743 if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage)
00744 {
00745 this->_M_impl.construct(this->_M_impl._M_finish, __x);
00746 ++this->_M_impl._M_finish;
00747 }
00748 else
00749 _M_insert_aux(end(), __x);
00750 }
00751
00752 #ifdef __GXX_EXPERIMENTAL_CXX0X__
00753 void
00754 push_back(value_type&& __x)
00755 { emplace_back(std::move(__x)); }
00756
00757 template<typename... _Args>
00758 void
00759 emplace_back(_Args&&... __args);
00760 #endif
00761
00762
00763
00764
00765
00766
00767
00768
00769
00770
00771 void
00772 pop_back()
00773 {
00774 --this->_M_impl._M_finish;
00775 this->_M_impl.destroy(this->_M_impl._M_finish);
00776 }
00777
00778 #ifdef __GXX_EXPERIMENTAL_CXX0X__
00779
00780
00781
00782
00783
00784
00785
00786
00787
00788
00789
00790
00791 template<typename... _Args>
00792 iterator
00793 emplace(iterator __position, _Args&&... __args);
00794 #endif
00795
00796
00797
00798
00799
00800
00801
00802
00803
00804
00805
00806
00807 iterator
00808 insert(iterator __position, const value_type& __x);
00809
00810 #ifdef __GXX_EXPERIMENTAL_CXX0X__
00811
00812
00813
00814
00815
00816
00817
00818
00819
00820
00821
00822 iterator
00823 insert(iterator __position, value_type&& __x)
00824 { return emplace(__position, std::move(__x)); }
00825
00826
00827
00828
00829
00830
00831
00832
00833
00834
00835
00836
00837
00838
00839 void
00840 insert(iterator __position, initializer_list<value_type> __l)
00841 { this->insert(__position, __l.begin(), __l.end()); }
00842 #endif
00843
00844
00845
00846
00847
00848
00849
00850
00851
00852
00853
00854
00855
00856
00857 void
00858 insert(iterator __position, size_type __n, const value_type& __x)
00859 { _M_fill_insert(__position, __n, __x); }
00860
00861
00862
00863
00864
00865
00866
00867
00868
00869
00870
00871
00872
00873
00874
00875 template<typename _InputIterator>
00876 void
00877 insert(iterator __position, _InputIterator __first,
00878 _InputIterator __last)
00879 {
00880
00881 typedef typename std::__is_integer<_InputIterator>::__type _Integral;
00882 _M_insert_dispatch(__position, __first, __last, _Integral());
00883 }
00884
00885
00886
00887
00888
00889
00890
00891
00892
00893
00894
00895
00896
00897
00898
00899
00900 iterator
00901 erase(iterator __position);
00902
00903
00904
00905
00906
00907
00908
00909
00910
00911
00912
00913
00914
00915
00916
00917
00918
00919
00920
00921 iterator
00922 erase(iterator __first, iterator __last);
00923
00924
00925
00926
00927
00928
00929
00930
00931
00932
00933 void
00934 swap(vector& __x)
00935 {
00936 std::swap(this->_M_impl._M_start, __x._M_impl._M_start);
00937 std::swap(this->_M_impl._M_finish, __x._M_impl._M_finish);
00938 std::swap(this->_M_impl._M_end_of_storage,
00939 __x._M_impl._M_end_of_storage);
00940
00941
00942
00943 std::__alloc_swap<_Tp_alloc_type>::_S_do_it(_M_get_Tp_allocator(),
00944 __x._M_get_Tp_allocator());
00945 }
00946
00947
00948
00949
00950
00951
00952
00953 void
00954 clear()
00955 { _M_erase_at_end(this->_M_impl._M_start); }
00956
00957 protected:
00958
00959
00960
00961
00962 template<typename _ForwardIterator>
00963 pointer
00964 _M_allocate_and_copy(size_type __n,
00965 _ForwardIterator __first, _ForwardIterator __last)
00966 {
00967 pointer __result = this->_M_allocate(__n);
00968 __try
00969 {
00970 std::__uninitialized_copy_a(__first, __last, __result,
00971 _M_get_Tp_allocator());
00972 return __result;
00973 }
00974 __catch(...)
00975 {
00976 _M_deallocate(__result, __n);
00977 __throw_exception_again;
00978 }
00979 }
00980
00981
00982
00983
00984
00985
00986
00987
00988 template<typename _Integer>
00989 void
00990 _M_initialize_dispatch(_Integer __n, _Integer __value, __true_type)
00991 {
00992 this->_M_impl._M_start = _M_allocate(static_cast<size_type>(__n));
00993 this->_M_impl._M_end_of_storage =
00994 this->_M_impl._M_start + static_cast<size_type>(__n);
00995 _M_fill_initialize(static_cast<size_type>(__n), __value);
00996 }
00997
00998
00999 template<typename _InputIterator>
01000 void
01001 _M_initialize_dispatch(_InputIterator __first, _InputIterator __last,
01002 __false_type)
01003 {
01004 typedef typename std::iterator_traits<_InputIterator>::
01005 iterator_category _IterCategory;
01006 _M_range_initialize(__first, __last, _IterCategory());
01007 }
01008
01009
01010 template<typename _InputIterator>
01011 void
01012 _M_range_initialize(_InputIterator __first,
01013 _InputIterator __last, std::input_iterator_tag)
01014 {
01015 for (; __first != __last; ++__first)
01016 push_back(*__first);
01017 }
01018
01019
01020 template<typename _ForwardIterator>
01021 void
01022 _M_range_initialize(_ForwardIterator __first,
01023 _ForwardIterator __last, std::forward_iterator_tag)
01024 {
01025 const size_type __n = std::distance(__first, __last);
01026 this->_M_impl._M_start = this->_M_allocate(__n);
01027 this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __n;
01028 this->_M_impl._M_finish =
01029 std::__uninitialized_copy_a(__first, __last,
01030 this->_M_impl._M_start,
01031 _M_get_Tp_allocator());
01032 }
01033
01034
01035
01036 void
01037 _M_fill_initialize(size_type __n, const value_type& __value)
01038 {
01039 std::__uninitialized_fill_n_a(this->_M_impl._M_start, __n, __value,
01040 _M_get_Tp_allocator());
01041 this->_M_impl._M_finish = this->_M_impl._M_end_of_storage;
01042 }
01043
01044
01045
01046
01047
01048
01049
01050
01051
01052 template<typename _Integer>
01053 void
01054 _M_assign_dispatch(_Integer __n, _Integer __val, __true_type)
01055 { _M_fill_assign(__n, __val); }
01056
01057
01058 template<typename _InputIterator>
01059 void
01060 _M_assign_dispatch(_InputIterator __first, _InputIterator __last,
01061 __false_type)
01062 {
01063 typedef typename std::iterator_traits<_InputIterator>::
01064 iterator_category _IterCategory;
01065 _M_assign_aux(__first, __last, _IterCategory());
01066 }
01067
01068
01069 template<typename _InputIterator>
01070 void
01071 _M_assign_aux(_InputIterator __first, _InputIterator __last,
01072 std::input_iterator_tag);
01073
01074
01075 template<typename _ForwardIterator>
01076 void
01077 _M_assign_aux(_ForwardIterator __first, _ForwardIterator __last,
01078 std::forward_iterator_tag);
01079
01080
01081
01082 void
01083 _M_fill_assign(size_type __n, const value_type& __val);
01084
01085
01086
01087
01088
01089
01090
01091
01092 template<typename _Integer>
01093 void
01094 _M_insert_dispatch(iterator __pos, _Integer __n, _Integer __val,
01095 __true_type)
01096 { _M_fill_insert(__pos, __n, __val); }
01097
01098
01099 template<typename _InputIterator>
01100 void
01101 _M_insert_dispatch(iterator __pos, _InputIterator __first,
01102 _InputIterator __last, __false_type)
01103 {
01104 typedef typename std::iterator_traits<_InputIterator>::
01105 iterator_category _IterCategory;
01106 _M_range_insert(__pos, __first, __last, _IterCategory());
01107 }
01108
01109
01110 template<typename _InputIterator>
01111 void
01112 _M_range_insert(iterator __pos, _InputIterator __first,
01113 _InputIterator __last, std::input_iterator_tag);
01114
01115
01116 template<typename _ForwardIterator>
01117 void
01118 _M_range_insert(iterator __pos, _ForwardIterator __first,
01119 _ForwardIterator __last, std::forward_iterator_tag);
01120
01121
01122
01123 void
01124 _M_fill_insert(iterator __pos, size_type __n, const value_type& __x);
01125
01126
01127 #ifndef __GXX_EXPERIMENTAL_CXX0X__
01128 void
01129 _M_insert_aux(iterator __position, const value_type& __x);
01130 #else
01131 template<typename... _Args>
01132 void
01133 _M_insert_aux(iterator __position, _Args&&... __args);
01134 #endif
01135
01136
01137 size_type
01138 _M_check_len(size_type __n, const char* __s) const
01139 {
01140 if (max_size() - size() < __n)
01141 __throw_length_error(__N(__s));
01142
01143 const size_type __len = size() + std::max(size(), __n);
01144 return (__len < size() || __len > max_size()) ? max_size() : __len;
01145 }
01146
01147
01148
01149
01150
01151 void
01152 _M_erase_at_end(pointer __pos)
01153 {
01154 std::_Destroy(__pos, this->_M_impl._M_finish, _M_get_Tp_allocator());
01155 this->_M_impl._M_finish = __pos;
01156 }
01157 };
01158
01159
01160
01161
01162
01163
01164
01165
01166
01167
01168
01169
01170 template<typename _Tp, typename _Alloc>
01171 inline bool
01172 operator==(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
01173 { return (__x.size() == __y.size()
01174 && std::equal(__x.begin(), __x.end(), __y.begin())); }
01175
01176
01177
01178
01179
01180
01181
01182
01183
01184
01185
01186
01187 template<typename _Tp, typename _Alloc>
01188 inline bool
01189 operator<(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
01190 { return std::lexicographical_compare(__x.begin(), __x.end(),
01191 __y.begin(), __y.end()); }
01192
01193
01194 template<typename _Tp, typename _Alloc>
01195 inline bool
01196 operator!=(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
01197 { return !(__x == __y); }
01198
01199
01200 template<typename _Tp, typename _Alloc>
01201 inline bool
01202 operator>(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
01203 { return __y < __x; }
01204
01205
01206 template<typename _Tp, typename _Alloc>
01207 inline bool
01208 operator<=(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
01209 { return !(__y < __x); }
01210
01211
01212 template<typename _Tp, typename _Alloc>
01213 inline bool
01214 operator>=(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
01215 { return !(__x < __y); }
01216
01217
01218 template<typename _Tp, typename _Alloc>
01219 inline void
01220 swap(vector<_Tp, _Alloc>& __x, vector<_Tp, _Alloc>& __y)
01221 { __x.swap(__y); }
01222
01223 _GLIBCXX_END_NESTED_NAMESPACE
01224
01225 #endif