Ticket #9334: circular_buffer.patch
File circular_buffer.patch, 2.9 KB (added by , 9 years ago) |
---|
-
boost/circular_buffer/base.hpp
old new 690 690 break; 691 691 } 692 692 if (is_uninitialized(dest)) { 693 ::new (dest) value_type(this_type::move_if_noexcept(*src));693 m_alloc.construct(dest, this_type::move_if_noexcept(*src)); 694 694 ++constructed; 695 695 } else { 696 696 value_type tmp = this_type::move_if_noexcept(*src); … … 1467 1467 increment(m_last); 1468 1468 m_first = m_last; 1469 1469 } else { 1470 ::new (m_last) value_type(static_cast<ValT>(item));1470 m_alloc.construct(m_last, static_cast<ValT>(item)); 1471 1471 increment(m_last); 1472 1472 ++m_size; 1473 1473 } … … 1484 1484 m_last = m_first; 1485 1485 } else { 1486 1486 decrement(m_first); 1487 ::new (m_first) value_type(static_cast<ValT>(item));1487 m_alloc.construct(m_first, static_cast<ValT>(item)); 1488 1488 ++m_size; 1489 1489 } 1490 1490 } BOOST_CATCH(...) { … … 2459 2459 */ 2460 2460 void construct_or_replace(bool construct, pointer pos, param_value_type item) { 2461 2461 if (construct) 2462 ::new (pos) value_type(item);2462 m_alloc.construct(pos, item); 2463 2463 else 2464 2464 replace(pos, item); 2465 2465 } … … 2471 2471 */ 2472 2472 void construct_or_replace(bool construct, pointer pos, rvalue_type item) { 2473 2473 if (construct) 2474 ::new (pos) value_type(boost::move(item));2474 m_alloc.construct(pos, boost::move(item)); 2475 2475 else 2476 2476 replace(pos, boost::move(item)); 2477 2477 } … … 2611 2611 if (buffer_capacity == 0) 2612 2612 return; 2613 2613 while (first != last && !full()) { 2614 ::new (m_last) value_type(*first++);2614 m_alloc.construct(m_last, *first++); 2615 2615 increment(m_last); 2616 2616 ++m_size; 2617 2617 } … … 2881 2881 pointer p = m_last; 2882 2882 BOOST_TRY { 2883 2883 for (; ii < construct; ++ii, increment(p)) 2884 ::new (p) value_type(*wrapper());2884 m_alloc.construct(p, *wrapper()); 2885 2885 for (;ii < n; ++ii, increment(p)) 2886 2886 replace(p, *wrapper()); 2887 2887 } BOOST_CATCH(...) { … … 2975 2975 for (;ii > construct; --ii, increment(p)) 2976 2976 replace(p, *wrapper()); 2977 2977 for (; ii > 0; --ii, increment(p)) 2978 ::new (p) value_type(*wrapper());2978 m_alloc.construct(p, *wrapper()); 2979 2979 } BOOST_CATCH(...) { 2980 2980 size_type constructed = ii < construct ? construct - ii : 0; 2981 2981 m_last = add(m_last, constructed);