Boost C++ Libraries: Ticket #11820: compilier error when using operator[] of map https://svn.boost.org/trac10/ticket/11820 <ol><li>I've define a map with specific Allocator, map&lt;key, value, less, <a class="missing wiki">MyAllocator</a>&gt; </li><li>if I call operator[] of this map, it will not find the right allocator </li></ol><p> mapped_type&amp; priv_subscript(BOOST_RV_REF(key_type) mk) </p> <blockquote> <p> { </p> <blockquote> <p> key_type &amp;k = mk; <em>we can optimize this iterator i = this-&gt;lower_bound(k); </em> i-&gt;first is greater than or equivalent to k. </p> <table class="wiki"> <tr>if (i == this-&gt;end() <td> this-&gt;key_comp()(k, (*i).first)){ </td></tr></table> <blockquote> <p> container_detail::value_init&lt;mapped_type&gt; m; movable_value_type val(boost::move(k), boost::move(m.m_t)); i = insert(i, boost::move(val)); </p> </blockquote> <p> } return (*i).second; </p> </blockquote> <p> } </p> </blockquote> <ol start="3"><li>because of this code " movable_value_type val(boost::move(k), boost::move(m.m_t)); " </li></ol><p> it will not new the right pair with right allocator when using operator[] </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/11820 Trac 1.4.3 viboes Sun, 06 Dec 2015 09:13:49 GMT component changed; owner set https://svn.boost.org/trac10/ticket/11820#comment:1 https://svn.boost.org/trac10/ticket/11820#comment:1 <ul> <li><strong>owner</strong> set to <span class="trac-author">Ion Gaztañaga</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">container</span> </li> </ul> Ticket Ion Gaztañaga Thu, 24 Dec 2015 00:17:18 GMT <link>https://svn.boost.org/trac10/ticket/11820#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11820#comment:2</guid> <description> <p> Thanks for the report. Can you check the following commit fixes your problem? </p> <p> <a class="ext-link" href="https://github.com/boostorg/container/commit/a3262c0ae75280f59ae7e9baa960e6873a5ae57f"><span class="icon">​</span>https://github.com/boostorg/container/commit/a3262c0ae75280f59ae7e9baa960e6873a5ae57f</a> </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Ion Gaztañaga</dc:creator> <pubDate>Thu, 11 Aug 2016 09:04:49 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/11820#comment:3 https://svn.boost.org/trac10/ticket/11820#comment:3 <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> Closed bug as no confirmation was obtained by the reporter. </p> Ticket