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>
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
iterator begin()
As per Table mumble.
void return_temporary_buffer(_Tp *__p)
The companion to get_temporary_buffer().
iterator_traits< _InputIterator >::difference_type distance(_InputIterator __first, _InputIterator __last)
A generalization of pointer arithmetic.
_T1 first
second_type is the second bound type
void _Destroy(_Tp *__pointer)
size_type size() const
As per Table mumble.
ISO C++ entities toplevel namespace is std.
pair< _Tp *, ptrdiff_t > get_temporary_buffer(ptrdiff_t __len) noexcept
Allocates a temporary buffer.
iterator end()
As per Table mumble.
_Tp * __addressof(_Tp &__r) noexcept
Same as C++11 std::addressof.
void _Construct(_T1 *__p, _Args &&...__args)
Struct holding two objects of arbitrary type.
_Temporary_buffer(_ForwardIterator __first, _ForwardIterator __last)
_T2 second
first is a copy of the first object
size_type requested_size() const
Returns the size requested by the constructor; may be >size().