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