58 #ifndef _STL_TEMPBUF_H
59 #define _STL_TEMPBUF_H 1
64 namespace std _GLIBCXX_VISIBILITY(default)
66 _GLIBCXX_BEGIN_NAMESPACE_VERSION
85 template<
typename _Tp>
89 const ptrdiff_t __max =
90 __gnu_cxx::__numeric_traits<ptrdiff_t>::__max /
sizeof(_Tp);
96 _Tp* __tmp =
static_cast<_Tp*
>(::operator
new(__len *
sizeof(_Tp),
112 template<
typename _Tp>
115 { ::operator
delete(__p, std::nothrow); }
123 template<
typename _ForwardIterator,
typename _Tp>
127 __glibcxx_class_requires(_ForwardIterator, _ForwardIteratorConcept)
130 typedef _Tp value_type;
131 typedef value_type* pointer;
132 typedef pointer iterator;
133 typedef ptrdiff_t size_type;
136 size_type _M_original_len;
149 {
return _M_original_len; }
154 {
return _M_buffer; }
159 {
return _M_buffer + _M_len; }
183 struct __uninitialized_construct_buf_dispatch
185 template<
typename _ForwardIterator,
typename _Tp>
187 __ucr(_ForwardIterator __first, _ForwardIterator __last,
190 if(__first == __last)
193 _ForwardIterator __cur = __first;
197 _GLIBCXX_MOVE(__value));
198 _ForwardIterator __prev = __cur;
200 for(; __cur != __last; ++__cur, ++__prev)
202 _GLIBCXX_MOVE(*__prev));
203 __value = _GLIBCXX_MOVE(*__prev);
208 __throw_exception_again;
214 struct __uninitialized_construct_buf_dispatch<true>
216 template<
typename _ForwardIterator,
typename _Tp>
218 __ucr(_ForwardIterator, _ForwardIterator, _Tp&) { }
231 template<
typename _ForwardIterator,
typename _Tp>
233 __uninitialized_construct_buf(_ForwardIterator __first,
234 _ForwardIterator __last,
237 typedef typename std::iterator_traits<_ForwardIterator>::value_type
240 std::__uninitialized_construct_buf_dispatch<
241 __has_trivial_constructor(_ValueType)>::
242 __ucr(__first, __last, __value);
245 template<
typename _ForwardIterator,
typename _Tp>
248 : _M_original_len(std::
distance(__first, __last)),
249 _M_len(0), _M_buffer(0)
254 value_type>(_M_original_len));
255 _M_buffer = __p.
first;
258 std::__uninitialized_construct_buf(_M_buffer, _M_buffer + _M_len,
266 __throw_exception_again;
270 _GLIBCXX_END_NAMESPACE_VERSION
iterator begin()
As per Table mumble.
_T1 first
second_type is the second bound type
pair< _Tp *, ptrdiff_t > get_temporary_buffer(ptrdiff_t __len) _GLIBCXX_NOEXCEPT
Allocates a temporary buffer.
_T2 second
first is a copy of the first object
void _Destroy(_Tp *__pointer)
size_type requested_size() const
Returns the size requested by the constructor; may be >size().
_Temporary_buffer(_ForwardIterator __first, _ForwardIterator __last)
iterator_traits< _InputIterator >::difference_type distance(_InputIterator __first, _InputIterator __last)
A generalization of pointer arithmetic.
size_type size() const
As per Table mumble.
Struct holding two objects of arbitrary type.
iterator end()
As per Table mumble.
void return_temporary_buffer(_Tp *__p)
The companion to get_temporary_buffer().
void _Construct(_T1 *__p, _Args &&...__args)
_Tp * __addressof(_Tp &__r) _GLIBCXX_NOEXCEPT
Same as C++11 std::addressof.