Alien-boost-mini
view release on metacpan or search on metacpan
include/boost/container/deque.hpp view on Meta::CPAN
//! <b>Effects</b>: Constructs a deque that will use a copy of allocator a
//! and inserts a copy of the range [first, last) in the deque.
//!
//! <b>Throws</b>: If allocator_type's default constructor
//! throws or T's constructor taking a dereferenced InIt throws.
//!
//! <b>Complexity</b>: Linear to the range [first, last).
template <class InIt>
deque(InIt first, InIt last
#if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
, typename dtl::disable_if_convertible
<InIt, size_type>::type * = 0
#endif
)
: Base(allocator_type())
{
this->priv_range_initialize(first, last);
}
//! <b>Effects</b>: Constructs a deque that will use a copy of allocator a
//! and inserts a copy of the range [first, last) in the deque.
//!
//! <b>Throws</b>: If allocator_type's default constructor
//! throws or T's constructor taking a dereferenced InIt throws.
//!
//! <b>Complexity</b>: Linear to the range [first, last).
template <class InIt>
deque(InIt first, InIt last, const allocator_type& a
#if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
, typename dtl::disable_if_convertible
<InIt, size_type>::type * = 0
#endif
)
: Base(a)
{
this->priv_range_initialize(first, last);
}
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
//! <b>Effects</b>: Constructs a deque that will use a copy of allocator a
//! and inserts a copy of the range [il.begin(), il.end()) in the deque.
//!
//! <b>Throws</b>: If allocator_type's default constructor
//! throws or T's constructor taking a dereferenced std::initializer_list iterator throws.
//!
//! <b>Complexity</b>: Linear to the range [il.begin(), il.end()).
deque(std::initializer_list<value_type> il, const allocator_type& a = allocator_type())
: Base(a)
{
this->priv_range_initialize(il.begin(), il.end());
}
#endif
//! <b>Effects</b>: Copy constructs a deque.
//!
//! <b>Postcondition</b>: x == *this.
//!
//! <b>Complexity</b>: Linear to the elements x contains.
deque(const deque& x)
: Base(allocator_traits_type::select_on_container_copy_construction(x.alloc()))
{
if(x.size()){
this->priv_initialize_map(x.size());
boost::container::uninitialized_copy_alloc
(this->alloc(), x.begin(), x.end(), this->members_.m_start);
}
}
//! <b>Effects</b>: Move constructor. Moves x's resources to *this.
//!
//! <b>Throws</b>: If allocator_type's copy constructor throws.
//!
//! <b>Complexity</b>: Constant.
deque(BOOST_RV_REF(deque) x) BOOST_NOEXCEPT_OR_NOTHROW
: Base(BOOST_MOVE_BASE(Base, x))
{ this->swap_members(x); }
//! <b>Effects</b>: Copy constructs a vector using the specified allocator.
//!
//! <b>Postcondition</b>: x == *this.
//!
//! <b>Throws</b>: If allocation
//! throws or T's copy constructor throws.
//!
//! <b>Complexity</b>: Linear to the elements x contains.
deque(const deque& x, const allocator_type &a)
: Base(a)
{
if(x.size()){
this->priv_initialize_map(x.size());
boost::container::uninitialized_copy_alloc
(this->alloc(), x.begin(), x.end(), this->members_.m_start);
}
}
//! <b>Effects</b>: Move constructor using the specified allocator.
//! Moves x's resources to *this if a == allocator_type().
//! Otherwise copies values from x to *this.
//!
//! <b>Throws</b>: If allocation or T's copy constructor throws.
//!
//! <b>Complexity</b>: Constant if a == x.get_allocator(), linear otherwise.
deque(BOOST_RV_REF(deque) x, const allocator_type &a)
: Base(a)
{
if(x.alloc() == a){
this->swap_members(x);
}
else{
if(x.size()){
this->priv_initialize_map(x.size());
boost::container::uninitialized_copy_alloc
( this->alloc(), boost::make_move_iterator(x.begin())
, boost::make_move_iterator(x.end()), this->members_.m_start);
}
}
}
//! <b>Effects</b>: Destroys the deque. All stored values are destroyed
//! and used memory is deallocated.
( run in 0.545 second using v1.01-cache-2.11-cpan-119454b85a5 )