Boost C++ Libraries: Ticket #13016: small buffer optimization for bool vector or dynamic_bitset https://svn.boost.org/trac10/ticket/13016 <p> The small_vector addition (<a class="closed ticket" href="https://svn.boost.org/trac10/ticket/9165" title="#9165: Feature Requests: small buffer optimization for vector or new container (closed: fixed)">#9165</a>) is great. However using this with Booleans gives space overhead. The std has anticipated this with the vector&lt;bool&gt; concept though not everybody is enthusiastic about this optimization. Unfortunately this one always allocates its data on the heap. What I need is the optimization of vector&lt;bool&gt; (or a dynamic_bitset) with the small buffer optimization. </p> <p> The use case is that I keep bool (or a bit postion) for every connected pin which goes from 0 to max pins. 99% of the use cases the maximum pins are less than 10 though I do not want to set a maximum on it beforehand (so e.g. use of std::bitset with 32 values would rule this out, since that one is topped to 32). </p> <p> see also <a class="ext-link" href="http://stackoverflow.com/questions/7760678/is-there-a-bitset-class-thats-sized-at-instantiation-time-but-avoids-boostdy"><span class="icon">​</span>http://stackoverflow.com/questions/7760678/is-there-a-bitset-class-thats-sized-at-instantiation-time-but-avoids-boostdy</a> </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/13016 Trac 1.4.3 Ion Gaztañaga Thu, 11 May 2017 12:33:46 GMT owner, component changed https://svn.boost.org/trac10/ticket/13016#comment:1 https://svn.boost.org/trac10/ticket/13016#comment:1 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Ion Gaztañaga</span> to <span class="trac-author">jsiek</span> </li> <li><strong>component</strong> <span class="trac-field-old">container</span> → <span class="trac-field-new">dynamic_bitset</span> </li> </ul> <p> Sorry but Boost.Container refused to have a boolean specialization for vector due to problems reported from std::vector and the idea is not to support any specialization for othe containers. More information here: </p> <p> <a href="http://www.boost.org/doc/libs/1_64_0/doc/html/container/Cpp11_conformance.html#container.Cpp11_conformance.Vector_bool">http://www.boost.org/doc/libs/1_64_0/doc/html/container/Cpp11_conformance.html#container.Cpp11_conformance.Vector_bool</a> </p> <p> Maybe this should proposed for Boost.<a class="missing wiki">DynamicBitset</a>. Reassigning. </p> Ticket