void uninitialized_copy_n_and_update(Allocator &a, Iterator p, size_type n) const
{ boost::container::uninitialized_value_init_alloc_n(a, n, p); }
- void copy_n_and_update(Allocator &, Iterator, size_type) const
- { BOOST_ASSERT(false); }
+ void copy_n_and_update(Allocator &a, Iterator p, size_type n) const
+ {
+ for (; 0 < n; --n, ++p){
+ typename dtl::aligned_storage<sizeof(value_type), dtl::alignment_of<value_type>::value>::type v;
+ value_type *vp = reinterpret_cast<value_type *>(v.data);
+ alloc_traits::construct(a, vp);
+ value_destructor<Allocator> on_exit(a, *vp); (void)on_exit;
+ *p = ::boost::move(*vp);
+ }
+ }
};
template<class Allocator, class Iterator>
void uninitialized_copy_n_and_update(Allocator &a, Iterator p, size_type n) const
{ boost::container::uninitialized_default_init_alloc_n(a, n, p); }
- void copy_n_and_update(Allocator &, Iterator, size_type) const
- { BOOST_ASSERT(false); }
+ void copy_n_and_update(Allocator &a, Iterator p, size_type n) const
+ {
+ if(!is_pod<value_type>::value){
+ for (; 0 < n; --n, ++p){
+ typename dtl::aligned_storage<sizeof(value_type), dtl::alignment_of<value_type>::value>::type v;
+ value_type *vp = reinterpret_cast<value_type *>(v.data);
+ alloc_traits::construct(a, vp, default_init);
+ value_destructor<Allocator> on_exit(a, *vp); (void)on_exit;
+ *p = ::boost::move(*vp);
+ }
+ }
+ }
};
template<class Allocator, class Iterator>
typedef typename alloc_traits::size_type size_type;
typedef typename alloc_traits::value_type value_type;
- explicit insert_move_proxy(value_type &v)
+ BOOST_CONTAINER_FORCEINLINE explicit insert_move_proxy(value_type &v)
: v_(v)
{}
- void uninitialized_copy_n_and_update(Allocator &a, Iterator p, size_type n) const
+ BOOST_CONTAINER_FORCEINLINE void uninitialized_copy_n_and_update(Allocator &a, Iterator p, size_type n) const
{
BOOST_ASSERT(n == 1); (void)n;
alloc_traits::construct( a, boost::movelib::iterator_to_raw_pointer(p), ::boost::move(v_) );
}
- void copy_n_and_update(Allocator &, Iterator p, size_type n) const
+ BOOST_CONTAINER_FORCEINLINE void copy_n_and_update(Allocator &, Iterator p, size_type n) const
{
BOOST_ASSERT(n == 1); (void)n;
*p = ::boost::move(v_);
void priv_copy_some_and_update(Allocator &a, const index_tuple<IdxPack...>&, Iterator p, size_type n)
{
BOOST_ASSERT(n ==1); (void)n;
- typename aligned_storage<sizeof(value_type), alignment_of<value_type>::value>::type v;
- value_type *vp = static_cast<value_type *>(static_cast<void *>(v.data));
+ typename dtl::aligned_storage<sizeof(value_type), dtl::alignment_of<value_type>::value>::type v;
+ value_type *vp = reinterpret_cast<value_type *>(v.data);
alloc_traits::construct(a, vp,
::boost::forward<Args>(get<IdxPack>(this->args_))...);
BOOST_TRY{
void copy_n_and_update(Allocator &a, Iterator p, size_type n)\
{\
BOOST_ASSERT(n == 1); (void)n;\
- typename aligned_storage<sizeof(value_type), alignment_of<value_type>::value>::type v;\
+ typename dtl::aligned_storage<sizeof(value_type), dtl::alignment_of<value_type>::value>::type v;\
BOOST_ASSERT((((size_type)(&v)) % alignment_of<value_type>::value) == 0);\
- value_type *vp = static_cast<value_type *>(static_cast<void *>(v.data));\
+ value_type *vp = reinterpret_cast<value_type *>(v.data);\
alloc_traits::construct(a, vp BOOST_MOVE_I##N BOOST_MOVE_MFWD##N);\
BOOST_TRY{\
*p = ::boost::move(*vp);\