Boost C++ Libraries: Ticket #12852: Resizing fills the circular buffer https://svn.boost.org/trac10/ticket/12852 <p> As the following block of code demonstrates, resizing a circular buffer fills it with values and thus full() reports true when one would expect it to be false. </p> <pre class="wiki"> boost::circular_buffer&lt;double&gt; cb(3); std::cout &lt;&lt; cb.full() &lt;&lt; std::endl; for (auto i : cb) std::cout &lt;&lt; i &lt;&lt; " "; std::cout &lt;&lt; std::endl; cb.resize(4); std::cout &lt;&lt; cb.full() &lt;&lt; std::endl; for (auto i : cb) std::cout &lt;&lt; i &lt;&lt; " "; std::cout &lt;&lt; std::endl; </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12852 Trac 1.4.3 anonymous Sat, 18 Feb 2017 09:28:41 GMT <link>https://svn.boost.org/trac10/ticket/12852#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12852#comment:1</guid> <description> <p> This is an expected behaviour. What you want is set_capacity() I guess. Please read resize() and set_capacity() documentation. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Jan Gaspar</dc:creator> <pubDate>Sat, 18 Feb 2017 09:34:56 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12852#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12852#comment:2</guid> <description> <p> This is an expected behaviour. What you want is set_capacity() I guess. Please read resize() and set_capacity() documentation. </p> </description> <category>Ticket</category> </item> <item> <author>b.n.ryland@…</author> <pubDate>Sat, 18 Feb 2017 20:54:09 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12852#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12852#comment:3</guid> <description> <p> Oh, right. Thanks! The documentation for this library was somewhat difficult to find from its homepage and I had not previously found set_capacity(). </p> </description> <category>Ticket</category> </item> </channel> </rss>