Mercurial > hg > CbC > CbC_llvm
comparison libcxx/include/stack @ 207:2e18cbf3894f
LLVM12
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 08 Jun 2021 06:07:14 +0900 |
parents | 1d019706d866 |
children | 5f17cb93ff66 |
comparison
equal
deleted
inserted
replaced
173:0572611fdcc8 | 207:2e18cbf3894f |
---|---|
146 _NOEXCEPT_(is_nothrow_move_assignable<container_type>::value) | 146 _NOEXCEPT_(is_nothrow_move_assignable<container_type>::value) |
147 {c = _VSTD::move(__q.c); return *this;} | 147 {c = _VSTD::move(__q.c); return *this;} |
148 | 148 |
149 _LIBCPP_INLINE_VISIBILITY | 149 _LIBCPP_INLINE_VISIBILITY |
150 explicit stack(container_type&& __c) : c(_VSTD::move(__c)) {} | 150 explicit stack(container_type&& __c) : c(_VSTD::move(__c)) {} |
151 #endif // _LIBCPP_CXX03_LANG | 151 #endif // _LIBCPP_CXX03_LANG |
152 | 152 |
153 _LIBCPP_INLINE_VISIBILITY | 153 _LIBCPP_INLINE_VISIBILITY |
154 explicit stack(const container_type& __c) : c(__c) {} | 154 explicit stack(const container_type& __c) : c(__c) {} |
155 | 155 |
156 template <class _Alloc> | 156 template <class _Alloc> |
157 _LIBCPP_INLINE_VISIBILITY | 157 _LIBCPP_INLINE_VISIBILITY |
158 explicit stack(const _Alloc& __a, | 158 explicit stack(const _Alloc& __a, |
159 typename enable_if<uses_allocator<container_type, | 159 _EnableIf<uses_allocator<container_type, _Alloc>::value>* = 0) |
160 _Alloc>::value>::type* = 0) | |
161 : c(__a) {} | 160 : c(__a) {} |
162 template <class _Alloc> | 161 template <class _Alloc> |
163 _LIBCPP_INLINE_VISIBILITY | 162 _LIBCPP_INLINE_VISIBILITY |
164 stack(const container_type& __c, const _Alloc& __a, | 163 stack(const container_type& __c, const _Alloc& __a, |
165 typename enable_if<uses_allocator<container_type, | 164 _EnableIf<uses_allocator<container_type, _Alloc>::value>* = 0) |
166 _Alloc>::value>::type* = 0) | |
167 : c(__c, __a) {} | 165 : c(__c, __a) {} |
168 template <class _Alloc> | 166 template <class _Alloc> |
169 _LIBCPP_INLINE_VISIBILITY | 167 _LIBCPP_INLINE_VISIBILITY |
170 stack(const stack& __s, const _Alloc& __a, | 168 stack(const stack& __s, const _Alloc& __a, |
171 typename enable_if<uses_allocator<container_type, | 169 _EnableIf<uses_allocator<container_type, _Alloc>::value>* = 0) |
172 _Alloc>::value>::type* = 0) | |
173 : c(__s.c, __a) {} | 170 : c(__s.c, __a) {} |
174 #ifndef _LIBCPP_CXX03_LANG | 171 #ifndef _LIBCPP_CXX03_LANG |
175 template <class _Alloc> | 172 template <class _Alloc> |
176 _LIBCPP_INLINE_VISIBILITY | 173 _LIBCPP_INLINE_VISIBILITY |
177 stack(container_type&& __c, const _Alloc& __a, | 174 stack(container_type&& __c, const _Alloc& __a, |
178 typename enable_if<uses_allocator<container_type, | 175 _EnableIf<uses_allocator<container_type, _Alloc>::value>* = 0) |
179 _Alloc>::value>::type* = 0) | |
180 : c(_VSTD::move(__c), __a) {} | 176 : c(_VSTD::move(__c), __a) {} |
181 template <class _Alloc> | 177 template <class _Alloc> |
182 _LIBCPP_INLINE_VISIBILITY | 178 _LIBCPP_INLINE_VISIBILITY |
183 stack(stack&& __s, const _Alloc& __a, | 179 stack(stack&& __s, const _Alloc& __a, |
184 typename enable_if<uses_allocator<container_type, | 180 _EnableIf<uses_allocator<container_type, _Alloc>::value>* = 0) |
185 _Alloc>::value>::type* = 0) | |
186 : c(_VSTD::move(__s.c), __a) {} | 181 : c(_VSTD::move(__s.c), __a) {} |
187 #endif // _LIBCPP_CXX03_LANG | 182 #endif // _LIBCPP_CXX03_LANG |
188 | 183 |
189 _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY | 184 _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY |
190 bool empty() const {return c.empty();} | 185 bool empty() const {return c.empty();} |
191 _LIBCPP_INLINE_VISIBILITY | 186 _LIBCPP_INLINE_VISIBILITY |
192 size_type size() const {return c.size();} | 187 size_type size() const {return c.size();} |
208 { return c.emplace_back(_VSTD::forward<_Args>(__args)...);} | 203 { return c.emplace_back(_VSTD::forward<_Args>(__args)...);} |
209 #else | 204 #else |
210 void emplace(_Args&&... __args) | 205 void emplace(_Args&&... __args) |
211 { c.emplace_back(_VSTD::forward<_Args>(__args)...);} | 206 { c.emplace_back(_VSTD::forward<_Args>(__args)...);} |
212 #endif | 207 #endif |
213 #endif // _LIBCPP_CXX03_LANG | 208 #endif // _LIBCPP_CXX03_LANG |
214 | 209 |
215 _LIBCPP_INLINE_VISIBILITY | 210 _LIBCPP_INLINE_VISIBILITY |
216 void pop() {c.pop_back();} | 211 void pop() {c.pop_back();} |
217 | 212 |
218 _LIBCPP_INLINE_VISIBILITY | 213 _LIBCPP_INLINE_VISIBILITY |
234 operator< (const stack<T1, _C1>& __x, const stack<T1, _C1>& __y); | 229 operator< (const stack<T1, _C1>& __x, const stack<T1, _C1>& __y); |
235 }; | 230 }; |
236 | 231 |
237 #ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES | 232 #ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES |
238 template<class _Container, | 233 template<class _Container, |
239 class = typename enable_if<!__is_allocator<_Container>::value, nullptr_t>::type | 234 class = _EnableIf<!__is_allocator<_Container>::value> |
240 > | 235 > |
241 stack(_Container) | 236 stack(_Container) |
242 -> stack<typename _Container::value_type, _Container>; | 237 -> stack<typename _Container::value_type, _Container>; |
243 | 238 |
244 template<class _Container, | 239 template<class _Container, |
245 class _Alloc, | 240 class _Alloc, |
246 class = typename enable_if<!__is_allocator<_Container>::value, nullptr_t>::type, | 241 class = _EnableIf<!__is_allocator<_Container>::value>, |
247 class = typename enable_if< __is_allocator<_Alloc>::value, nullptr_t>::type | 242 class = _EnableIf<__is_allocator<_Alloc>::value> |
248 > | 243 > |
249 stack(_Container, _Alloc) | 244 stack(_Container, _Alloc) |
250 -> stack<typename _Container::value_type, _Container>; | 245 -> stack<typename _Container::value_type, _Container>; |
251 #endif | 246 #endif |
252 | 247 |
298 return !(__y < __x); | 293 return !(__y < __x); |
299 } | 294 } |
300 | 295 |
301 template <class _Tp, class _Container> | 296 template <class _Tp, class _Container> |
302 inline _LIBCPP_INLINE_VISIBILITY | 297 inline _LIBCPP_INLINE_VISIBILITY |
303 typename enable_if< | 298 _EnableIf<__is_swappable<_Container>::value, void> |
304 __is_swappable<_Container>::value, | |
305 void | |
306 >::type | |
307 swap(stack<_Tp, _Container>& __x, stack<_Tp, _Container>& __y) | 299 swap(stack<_Tp, _Container>& __x, stack<_Tp, _Container>& __y) |
308 _NOEXCEPT_(_NOEXCEPT_(__x.swap(__y))) | 300 _NOEXCEPT_(_NOEXCEPT_(__x.swap(__y))) |
309 { | 301 { |
310 __x.swap(__y); | 302 __x.swap(__y); |
311 } | 303 } |
316 { | 308 { |
317 }; | 309 }; |
318 | 310 |
319 _LIBCPP_END_NAMESPACE_STD | 311 _LIBCPP_END_NAMESPACE_STD |
320 | 312 |
321 #endif // _LIBCPP_STACK | 313 #endif // _LIBCPP_STACK |