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