Boost C++ Libraries: Ticket #1692: 'iterator::m_it' declared public ONLY in test/debug-build, but always accessed from 'cicular_buffer::erase()' https://svn.boost.org/trac10/ticket/1692 <p> In the current version of boost::circular_buffer, there is a small bug where <em>iterator::m_it</em> is declared <em>private</em> if not in test-mode (explains why this didn't get caught) but accessed from <em>circular_buffer::erase(iterator, iterator)</em> even in non-debug/non-test mode. This just causes a compiler error. </p> <p> (I think just adding </p> <blockquote> <p> template &lt;class T, class Alloc&gt; friend class circular_buffer; </p> </blockquote> <blockquote> <p> should be enough. </p> </blockquote> <p> ) </p> <hr /> <pre class="wiki">/boost/boost/circular_buffer/details.hpp (r1.4) class iterator 222 #if !defined(BOOST_CB_TEST) &amp;&amp; !BOOST_CB_ENABLE_DEBUG 223 private: 224 #endif 225 // Member variables 226 227 //! The circular buffer where the iterator points to. 228 const Buff* m_buff; 229 230 //! An internal iterator. 231 pointer m_it; </pre><p> --- </p> <pre class="wiki">/boost/boost/circular_buffer/base.hpp (r1.8) circular_buffer::erase(iterator, iterator) 1717 pointer next = pos.m_it; </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/1692 Trac 1.4.3 Jan Gaspar Mon, 17 Mar 2008 21:58:24 GMT severity changed https://svn.boost.org/trac10/ticket/1692#comment:1 https://svn.boost.org/trac10/ticket/1692#comment:1 <ul> <li><strong>severity</strong> <span class="trac-field-old">Problem</span> → <span class="trac-field-new">Showstopper</span> </li> </ul> Ticket Jan Gaspar Mon, 17 Mar 2008 22:00:57 GMT status changed https://svn.boost.org/trac10/ticket/1692#comment:2 https://svn.boost.org/trac10/ticket/1692#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> <p> Several more methods are affected, not only erase(). </p> <p> I would fix it by declaring the members as public - friend does not work for all compilers in this case. </p> Ticket Jan Gaspar Wed, 19 Mar 2008 09:19:33 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/1692#comment:3 https://svn.boost.org/trac10/ticket/1692#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> Ticket