Boost C++ Libraries: Ticket #13276: circular_buffer pulls in exception handling code https://svn.boost.org/trac10/ticket/13276 <p> <code>circular_buffer</code> as shipped doesn't work for embedded applications - it ends up adding EH (and thus <code>printf</code>, etc.), which adds unacceptable bloat for devices without much flash. The problem is that, even if you create a non-throwing allocator, <code>circular_buffer::allocate(size_type n)</code> still first checks <code>n</code> against the allocator's <code>max_size()</code>, and throws if it is too large. </p> <p> As I understand it, an allocator should throw/assert anyway (depending on whether it's using EH or not) if you try to <code>allocate()</code> more than <code>max_size()</code>, so I've been patching by deleting the involved lines: </p> <pre class="wiki">- if (n &gt; max_size()) - throw_exception(std::length_error("circular_buffer")); </pre><p> These lines should at least get excluded from compilation, or replaced with an assert, if <code>BOOST_NOEXCEPT</code> is defined. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/13276 Trac 1.4.3 Doug Brunner <doug.a.brunner@…> Thu, 26 Oct 2017 19:11:29 GMT cc set https://svn.boost.org/trac10/ticket/13276#comment:1 https://svn.boost.org/trac10/ticket/13276#comment:1 <ul> <li><strong>cc</strong> <span class="trac-author">doug.a.brunner@…</span> added </li> </ul> Ticket