57#define _STL_TEMPBUF_H 1
62namespace std _GLIBCXX_VISIBILITY(default)
64_GLIBCXX_BEGIN_NAMESPACE_VERSION
68 template<
typename _Tp>
70 __return_temporary_buffer(_Tp* __p,
71 size_t __len __attribute__((__unused__)))
73#if __cpp_sized_deallocation
74 ::operator
delete(__p, __len *
sizeof(_Tp));
76 ::operator
delete(__p);
98 template<
typename _Tp>
102 const ptrdiff_t __max =
103 __gnu_cxx::__numeric_traits<ptrdiff_t>::__max /
sizeof(_Tp);
109 _Tp* __tmp =
static_cast<_Tp*
>(::operator
new(__len *
sizeof(_Tp),
113 __len = __len == 1 ? 0 : ((__len + 1) / 2);
125 template<
typename _Tp>
128 { ::operator
delete(__p); }
135 template<
typename _ForwardIterator,
typename _Tp>
139 __glibcxx_class_requires(_ForwardIterator, _ForwardIteratorConcept)
142 typedef _Tp value_type;
143 typedef value_type* pointer;
144 typedef pointer iterator;
145 typedef ptrdiff_t size_type;
148 size_type _M_original_len;
161 {
return _M_original_len; }
166 {
return _M_buffer; }
171 {
return _M_buffer + _M_len; }
182 std::__detail::__return_temporary_buffer(_M_buffer, _M_len);
195 struct __uninitialized_construct_buf_dispatch
197 template<
typename _Po
inter,
typename _ForwardIterator>
199 __ucr(_Pointer __first, _Pointer __last,
200 _ForwardIterator __seed)
202 if (__first == __last)
205 _Pointer __cur = __first;
209 _GLIBCXX_MOVE(*__seed));
210 _Pointer __prev = __cur;
212 for(; __cur != __last; ++__cur, ++__prev)
214 _GLIBCXX_MOVE(*__prev));
215 *__seed = _GLIBCXX_MOVE(*__prev);
220 __throw_exception_again;
226 struct __uninitialized_construct_buf_dispatch<true>
228 template<
typename _Po
inter,
typename _ForwardIterator>
230 __ucr(_Pointer, _Pointer, _ForwardIterator) { }
243 template<
typename _Po
inter,
typename _ForwardIterator>
245 __uninitialized_construct_buf(_Pointer __first, _Pointer __last,
246 _ForwardIterator __seed)
251 std::__uninitialized_construct_buf_dispatch<
252 __has_trivial_constructor(_ValueType)>::
253 __ucr(__first, __last, __seed);
256 template<
typename _ForwardIterator,
typename _Tp>
259 : _M_original_len(__original_len), _M_len(0), _M_buffer(0)
262 std::get_temporary_buffer<value_type>(_M_original_len));
270 _M_buffer = __p.
first;
275 std::__detail::__return_temporary_buffer(__p.
first, __p.
second);
276 __throw_exception_again;
281_GLIBCXX_END_NAMESPACE_VERSION
constexpr _Tp * __addressof(_Tp &__r) noexcept
Same as C++11 std::addressof.
ISO C++ entities toplevel namespace is std.
pair< _Tp *, ptrdiff_t > get_temporary_buffer(ptrdiff_t __len) noexcept
Allocates a temporary buffer.
void return_temporary_buffer(_Tp *__p)
The companion to get_temporary_buffer().
constexpr void _Construct(_Tp *__p, _Args &&... __args)
void _Destroy(_ForwardIterator __first, _ForwardIterator __last, _Allocator &__alloc)
Traits class for iterators.
Struct holding two objects of arbitrary type.
_T1 first
The first member.
_T2 second
The second member.
iterator end()
As per Table mumble.
size_type requested_size() const
Returns the size requested by the constructor; may be >size().
size_type size() const
As per Table mumble.
iterator begin()
As per Table mumble.
_Temporary_buffer(_ForwardIterator __seed, size_type __original_len)