Ticket #10543: 002-circular-buffer-const_cast-generalization.patch

File 002-circular-buffer-const_cast-generalization.patch, 686 bytes (added by Matteo Settenvini <matteo.settenvini@…>, 8 years ago)

Use boost::intrusive::pointer_traits to specialize the const_cast on the pointer type.

  • boost/circular_buffer/base.hpp

    old new  
    755755        BOOST_CB_ASSERT(new_begin.is_valid(this)); // check for uninitialized or invalidated iterator
    756756        BOOST_CB_ASSERT(new_begin.m_it != 0);      // check for iterator pointing to end()
    757757        if (full()) {
    758             m_first = m_last = const_cast<pointer>(new_begin.m_it);
     758            m_first = m_last = boost::intrusive::pointer_traits<pointer>::const_cast_from(new_begin.m_it);
    759759        } else {
    760760            difference_type m = end() - new_begin;
    761761            difference_type n = new_begin - begin();