Boost C++ Libraries: Ticket #13299: small_vector<..>::emplace_back does not return the new element's reference https://svn.boost.org/trac10/ticket/13299 <p> I want to emplace a new item at the back of a small_vector and use the reference to the new item: </p> <pre class="wiki">boost::container::small_vector&lt;int,16&gt; myVec; auto&amp; newItem = myVec.emplace_back(10); assert(newItem == 10); /* this fails */ </pre><p> It seems like the returned reference points to the last element of the internal array (like myVec<a class="changeset" href="https://svn.boost.org/trac10/changeset/15" title="*** empty log message *** ">[15]</a>). This element is uninitialized. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/13299 Trac 1.4.3 Ion Gaztañaga Tue, 01 May 2018 13:31:20 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/13299#comment:1 https://svn.boost.org/trac10/ticket/13299#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> Seems to be the same problem as explained in: </p> <p> <a class="ext-link" href="https://github.com/boostorg/container/pull/45"><span class="icon">​</span>https://github.com/boostorg/container/pull/45</a> </p> <p> which was fixed for Boost 1.64. Many thanks for the report. </p> Ticket