libstdc++
GNU C++ library
Loading...
Searching...
No Matches

◆ _M_range_initialize() [2/2]

template<typename _Tp, typename _Alloc>
template<typename _InputIterator>
void deque::_M_range_initialize ( _InputIterator __first,
_InputIterator __last,
std::input_iterator_tag  )
protected

Fills the deque with whatever is in [first,last).

Parameters
__firstAn input iterator.
__lastAn input iterator.
Returns
Nothing.

If the iterators are actually forward iterators (or better), then the memory layout can be done all at once. Else we move forward using push_back on each value from the iterator.

Definition at line 419 of file deque.tcc.

422 {
423 this->_M_initialize_map(0);
424 __try
425 {
426 for (; __first != __last; ++__first)
427#if __cplusplus >= 201103L
429#else
431#endif
432 }
433 __catch(...)
434 {
435 clear();
437 }
438 }
#define __catch(X)
void _M_initialize_map(size_t)
Layout storage.
Definition stl_deque.h:642
void clear() noexcept
Definition stl_deque.h:1934
void push_back(const value_type &__x)
Add data to the end of the deque.
Definition stl_deque.h:1605
reference emplace_back(_Args &&... __args)
Definition deque.tcc:165
A standard container using fixed-size memory allocation and constant-time manipulation of elements at...
Definition stl_deque.h:792

References deque(), __catch, __throw_exception_again, __try, _M_initialize_map(), clear(), emplace_back(), and push_back().

Here is the call graph for this function: