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