Boost C++ Libraries: Ticket #6089: Non const & used in ptr_map::insert https://svn.boost.org/trac10/ticket/6089 <p> The boost::ptr_map inserter takes a "key_type &amp;" rather than a "const key_type &amp;." This is annoying if you have a function that takes a const &amp;. I've attached a patch which should fix the problem. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6089 Trac 1.4.3 jdoliner@… Thu, 03 Nov 2011 18:25:23 GMT attachment set https://svn.boost.org/trac10/ticket/6089 https://svn.boost.org/trac10/ticket/6089 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">patch</span> </li> </ul> <p> A patch which fixes the problem. </p> Ticket Alex Ku <alex.s.kudinov@…> Fri, 05 Apr 2013 03:27:17 GMT <link>https://svn.boost.org/trac10/ticket/6089#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6089#comment:1</guid> <description> <p> still exists in 1.53.0 </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Wed, 02 Nov 2016 19:44:40 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6089#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6089#comment:2</guid> <description> <p> Still there is 1.62.0 and causes the most basic examples of ptr_map to fail to compile. For instance: </p> <pre class="wiki"> boost::ptr_map&lt;int, int&gt; m; m.insert(0, new int(5)); </pre><p> It's literally a one word change to fix this. </p> </description> <category>Ticket</category> </item> <item> <author>m.champlon@…</author> <pubDate>Tue, 17 Jan 2017 22:15:34 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6089#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6089#comment:3</guid> <description> <p> I believe this is actually a feature, see www.boost.org/libs/ptr_container/doc/faq.html#why-does-ptr-map-t-insert-replace-take-two-arguments-the-key-and-the-pointer-instead-of-one-std-pair-and-why-is-the-key-passed-by-non-const-reference for a rationale. </p> </description> <category>Ticket</category> </item> </channel> </rss>