56 #ifndef _STL_TEMPBUF_H
57 #define _STL_TEMPBUF_H 1
62 namespace std _GLIBCXX_VISIBILITY(default)
64 _GLIBCXX_BEGIN_NAMESPACE_VERSION
83 template<
typename _Tp>
87 const ptrdiff_t __max =
88 __gnu_cxx::__numeric_traits<ptrdiff_t>::__max /
sizeof(_Tp);
94 _Tp* __tmp =
static_cast<_Tp*
>(::operator
new(__len *
sizeof(_Tp),
110 template<
typename _Tp>
113 { ::operator
delete(__p, std::nothrow); }
121 template<
typename _ForwardIterator,
typename _Tp>
125 __glibcxx_class_requires(_ForwardIterator, _ForwardIteratorConcept)
128 typedef _Tp value_type;
129 typedef value_type* pointer;
130 typedef pointer iterator;
131 typedef ptrdiff_t size_type;
134 size_type _M_original_len;
147 {
return _M_original_len; }
152 {
return _M_buffer; }
157 {
return _M_buffer + _M_len; }
181 struct __uninitialized_construct_buf_dispatch
183 template<
typename _Po
inter,
typename _ForwardIterator>
185 __ucr(_Pointer __first, _Pointer __last,
186 _ForwardIterator __seed)
188 if(__first == __last)
191 _Pointer __cur = __first;
195 _GLIBCXX_MOVE(*__seed));
196 _Pointer __prev = __cur;
198 for(; __cur != __last; ++__cur, ++__prev)
200 _GLIBCXX_MOVE(*__prev));
201 *__seed = _GLIBCXX_MOVE(*__prev);
206 __throw_exception_again;
212 struct __uninitialized_construct_buf_dispatch<true>
214 template<
typename _Po
inter,
typename _ForwardIterator>
216 __ucr(_Pointer, _Pointer, _ForwardIterator) { }
229 template<
typename _Po
inter,
typename _ForwardIterator>
231 __uninitialized_construct_buf(_Pointer __first, _Pointer __last,
232 _ForwardIterator __seed)
234 typedef typename std::iterator_traits<_Pointer>::value_type
237 std::__uninitialized_construct_buf_dispatch<
238 __has_trivial_constructor(_ValueType)>::
239 __ucr(__first, __last, __seed);
242 template<
typename _ForwardIterator,
typename _Tp>
245 : _M_original_len(std::
distance(__first, __last)),
246 _M_len(0), _M_buffer(0)
251 value_type>(_M_original_len));
252 _M_buffer = __p.
first;
255 std::__uninitialized_construct_buf(_M_buffer, _M_buffer + _M_len,
263 __throw_exception_again;
267 _GLIBCXX_END_NAMESPACE_VERSION