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 _GLIBCXX_PROFILE_FORWARD_LIST
00030 #define _GLIBCXX_PROFILE_FORWARD_LIST 1
00031
00032 #ifndef __GXX_EXPERIMENTAL_CXX0X__
00033 # include <bits/c++0x_warning.h>
00034 #else
00035
00036 #include <forward_list>
00037
00038 namespace std _GLIBCXX_VISIBILITY(default)
00039 {
00040 namespace __profile
00041 {
00042
00043 template<typename _Tp, typename _Alloc = std::allocator<_Tp> >
00044 class forward_list
00045 : public _GLIBCXX_STD_C::forward_list<_Tp, _Alloc>
00046 {
00047 typedef _GLIBCXX_STD_C::forward_list<_Tp, _Alloc> _Base;
00048
00049 public:
00050 typedef typename _Base::size_type size_type;
00051
00052 public:
00053
00054 explicit
00055 forward_list(const _Alloc& __al = _Alloc())
00056 : _Base(__al) { }
00057
00058 forward_list(const forward_list& __list, const _Alloc& __al)
00059 : _Base(__list, __al)
00060 { }
00061
00062 forward_list(forward_list&& __list, const _Alloc& __al)
00063 : _Base(std::move(__list), __al)
00064 { }
00065
00066 explicit
00067 forward_list(size_type __n)
00068 : _Base(__n)
00069 { }
00070
00071 forward_list(size_type __n, const _Tp& __value,
00072 const _Alloc& __al = _Alloc())
00073 : _Base(__n, __value, __al)
00074 { }
00075
00076 template<typename _InputIterator>
00077 forward_list(_InputIterator __first, _InputIterator __last,
00078 const _Alloc& __al = _Alloc())
00079 : _Base(__first, __last, __al)
00080 { }
00081
00082 forward_list(const forward_list& __list)
00083 : _Base(__list)
00084 { }
00085
00086 forward_list(forward_list&& __list)
00087 : _Base(std::move(__list)) { }
00088
00089 forward_list(std::initializer_list<_Tp> __il,
00090 const _Alloc& __al = _Alloc())
00091 : _Base(__il, __al)
00092 { }
00093
00094 ~forward_list()
00095 { }
00096
00097 forward_list&
00098 operator=(const forward_list& __list)
00099 {
00100 static_cast<_Base&>(*this) = __list;
00101 return *this;
00102 }
00103
00104 forward_list&
00105 operator=(forward_list&& __list)
00106 {
00107
00108
00109 _Base::clear();
00110 _Base::swap(__list);
00111 return *this;
00112 }
00113
00114 forward_list&
00115 operator=(std::initializer_list<_Tp> __il)
00116 {
00117 static_cast<_Base&>(*this) = __il;
00118 return *this;
00119 }
00120
00121 _Base&
00122 _M_base() { return *this; }
00123
00124 const _Base&
00125 _M_base() const { return *this; }
00126 };
00127
00128 template<typename _Tp, typename _Alloc>
00129 inline bool
00130 operator==(const forward_list<_Tp, _Alloc>& __lx,
00131 const forward_list<_Tp, _Alloc>& __ly)
00132 { return __lx._M_base() == __ly._M_base(); }
00133
00134 template<typename _Tp, typename _Alloc>
00135 inline bool
00136 operator<(const forward_list<_Tp, _Alloc>& __lx,
00137 const forward_list<_Tp, _Alloc>& __ly)
00138 { return __lx._M_base() < __ly._M_base(); }
00139
00140 template<typename _Tp, typename _Alloc>
00141 inline bool
00142 operator!=(const forward_list<_Tp, _Alloc>& __lx,
00143 const forward_list<_Tp, _Alloc>& __ly)
00144 { return !(__lx == __ly); }
00145
00146
00147 template<typename _Tp, typename _Alloc>
00148 inline bool
00149 operator>(const forward_list<_Tp, _Alloc>& __lx,
00150 const forward_list<_Tp, _Alloc>& __ly)
00151 { return (__ly < __lx); }
00152
00153
00154 template<typename _Tp, typename _Alloc>
00155 inline bool
00156 operator>=(const forward_list<_Tp, _Alloc>& __lx,
00157 const forward_list<_Tp, _Alloc>& __ly)
00158 { return !(__lx < __ly); }
00159
00160
00161 template<typename _Tp, typename _Alloc>
00162 inline bool
00163 operator<=(const forward_list<_Tp, _Alloc>& __lx,
00164 const forward_list<_Tp, _Alloc>& __ly)
00165 { return !(__ly < __lx); }
00166
00167
00168 template<typename _Tp, typename _Alloc>
00169 inline void
00170 swap(forward_list<_Tp, _Alloc>& __lx,
00171 forward_list<_Tp, _Alloc>& __ly)
00172 { __lx.swap(__ly); }
00173
00174 }
00175 }
00176
00177 #endif // __GXX_EXPERIMENTAL_CXX0X__
00178
00179 #endif