Re: [Boost-bugs] [Boost C++ Libraries] #6575: copy_remaining_to and copy_some_and_update don't use allocator_traits for construction

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #6575: copy_remaining_to and copy_some_and_update don't use allocator_traits for construction
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-02-19 03:09:07


#6575: copy_remaining_to and copy_some_and_update don't use allocator_traits for
construction
-------------------------------------------------+--------------------------
  Reporter: Erik Jensen <Erik.Jensen@…> | Owner: igaztanaga
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: container
   Version: Boost 1.49.0 | Severity: Problem
Resolution: | Keywords:
-------------------------------------------------+--------------------------

Comment (by Erik Jensen <Erik.Jensen@…>):

 Err... forgot to destruct the temporary. It should have been this:
 {{{
 virtual void copy_remaining_to(Iterator p)
 \
 {
 \
    if(!this->used_){
 \
       aligned_storage<sizeof(value_type), alignment_of<value_type>::value>
 v; \
       value_type *vp = static_cast<value_type *>(static_cast<void *>(&v));
 \
       alloc_traits::construct(a_, vp
 \
          BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_MEMBER_FORWARD, _));
 \
       try {
 \
          *p = boost::move(*vp);
 \
       } catch (...) {
 \
          alloc_traits::destroy(a_, vp);
 \
          throw;
 \
       }
 \
       alloc_traits::destroy(a_, vp);
 \
       this->used_ = true;
 \
    }
 \
 }
 \
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/6575#comment:3>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:09 UTC