Boost C++ Libraries: Ticket #10543: circular_buffer::rotate() incorrectly assumes that circular_buffer::pointer is a simple pointer type https://svn.boost.org/trac10/ticket/10543 <p> Dear maintainer, </p> <p> I am trying to use a boost::circular_buffer inside a shared memory segment, along with Boost.Interprocess. This implies that the type of the stored pointer is an offset_ptr&lt;T&gt;, and not just a T *. </p> <p> In circular_buffer/base.hpp, the rotate method uses a const_cast from the member of a const iterator, assuming that "pointer" is indeed a simple pointer type. This however fails when it is instead a structure, such as boost::interprocess::offset_ptr&lt;T&gt;. </p> <p> The patch I am attaching below solves the issue for me, by allowing the right template specialization to kick in. I did not test it with different pointer types as I am a bit short on time, but by reading the code alone, it should work also with plain pointers. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/10543 Trac 1.4.3 Matteo Settenvini <matteo.settenvini@…> Fri, 26 Sep 2014 11:37:37 GMT attachment set https://svn.boost.org/trac10/ticket/10543 https://svn.boost.org/trac10/ticket/10543 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">002-circular-buffer-const_cast-generalization.patch</span> </li> </ul> <p> Use boost::intrusive::pointer_traits to specialize the const_cast on the pointer type. </p> Ticket anonymous Fri, 03 Oct 2014 20:26:38 GMT <link>https://svn.boost.org/trac10/ticket/10543#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10543#comment:1</guid> <description> <p> Please apply the patch to the trunk. </p> </description> <category>Ticket</category> </item> <item> <author>matteo.settenvini@…</author> <pubDate>Fri, 11 Dec 2015 13:28:07 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/10543#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10543#comment:2</guid> <description> <p> Any chance of getting this in before 1.60 is released? </p> </description> <category>Ticket</category> </item> </channel> </rss>