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