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>
100 pair<_Tp*, ptrdiff_t>
103 const ptrdiff_t __max =
104 __gnu_cxx::__numeric_traits<ptrdiff_t>::__max /
sizeof(_Tp);
110 _Tp* __tmp =
static_cast<_Tp*
>(::operator
new(__len *
sizeof(_Tp),
114 __len = __len == 1 ? 0 : ((__len + 1) / 2);
126 template<
typename _Tp>
129 { ::operator
delete(__p); }
136 template<
typename _ForwardIterator,
typename _Tp>
140 __glibcxx_class_requires(_ForwardIterator, _ForwardIteratorConcept)
143 typedef _Tp value_type;
144 typedef value_type* pointer;
145 typedef pointer iterator;
146 typedef ptrdiff_t size_type;
149 size_type _M_original_len;
162 {
return _M_original_len; }
167 {
return _M_buffer; }
172 {
return _M_buffer + _M_len; }
183 std::__detail::__return_temporary_buffer(_M_buffer, _M_len);
196 struct __uninitialized_construct_buf_dispatch
198 template<
typename _Po
inter,
typename _ForwardIterator>
200 __ucr(_Pointer __first, _Pointer __last,
201 _ForwardIterator __seed)
203 if (__first == __last)
206 _Pointer __cur = __first;
210 _GLIBCXX_MOVE(*__seed));
211 _Pointer __prev = __cur;
213 for(; __cur != __last; ++__cur, ++__prev)
215 _GLIBCXX_MOVE(*__prev));
216 *__seed = _GLIBCXX_MOVE(*__prev);
221 __throw_exception_again;
227 struct __uninitialized_construct_buf_dispatch<true>
229 template<
typename _Po
inter,
typename _ForwardIterator>
231 __ucr(_Pointer, _Pointer, _ForwardIterator) { }
244 template<
typename _Po
inter,
typename _ForwardIterator>
246 __uninitialized_construct_buf(_Pointer __first, _Pointer __last,
247 _ForwardIterator __seed)
252 std::__uninitialized_construct_buf_dispatch<
253 __has_trivial_constructor(_ValueType)>::
254 __ucr(__first, __last, __seed);
257 template<
typename _ForwardIterator,
typename _Tp>
260 : _M_original_len(__original_len), _M_len(0), _M_buffer(0)
263 std::get_temporary_buffer<value_type>(_M_original_len));
271 _M_buffer = __p.
first;
276 std::__detail::__return_temporary_buffer(__p.
first, __p.
second);
277 __throw_exception_again;
282_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)
constexpr 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)