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