Boost C++ Libraries: Ticket #730: The ptr_map iterator cannot be dereference to value type https://svn.boost.org/trac10/ticket/730 <pre class="wiki">The following code was built and worded well under VS.NET 2003 and boost v1.33. But under boost v1.34, it cannot built // testshareptr.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include "C:\Dev\Head\Third Party Libraries\Public Headers\boost\ptr_container\ptr_map.hpp" #include "C:\Dev\Head\Third Party Libraries\Public Headers\boost\ptr_container\ptr_vector.hpp" #include "C:\Dev\Head\Third Party Libraries\Public Headers\boost\signal.hpp" #include "C:\Dev\Head\Third Party Libraries\Public Headers\boost\signals\slot.hpp" #include "C:\Dev\Head\Third Party Libraries\Public Headers\boost\signals\trackable.hpp" #include "C:\Dev\Head\Third Party Libraries\Public Headers\boost\signals\connection.hpp" #include "C:\Dev\Head\Third Party Libraries\Public Headers\boost\visit_each.hpp" #include "C:\Dev\Head\Third Party Libraries\Public Headers\boost\last_value.hpp" #include "C:\Dev\Head\Third Party Libraries\Public Headers\boost\lambda\algorithm.hpp" #include &lt;algorithm&gt; #include &lt;functional&gt; class TValue { private: int m_n; public: TValue(int n = 0) { m_n = n; printf("I am brith at %i\n", m_n); } ~TValue() { printf("I am %i and dying\n", m_n); } void WhoIs() { printf("I am %i\n", m_n); } int Get(void) const {return m_n;} int Get2(void) {return m_n;} }; typedef boost::ptr_map&lt;int, TValue&gt;CMyMap; bool Larger(const TValue&amp; p1, const TValue&amp; p2) { bool bRet = false; bRet = (p2.Get() &lt;= p1.Get() &amp;&amp; (p2.Get()%2==0)); return bRet; } void TestCase1() { printf("\n\n======================TestCase 1:======================\n"); CMyMap mymap; for(int i = 0; i &lt; 10; ++i) { mymap.insert(i, new TValue(i)); } std::stable_sort(mymap.begin(), mymap.end(), Larger); } int _tmain(int argc, _TCHAR* argv[]) { TestCase1(); return 0; } </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/730 Trac 1.4.3 Thorsten Ottosen Tue, 24 Oct 2006 16:26:50 GMT <link>https://svn.boost.org/trac10/ticket/730#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/730#comment:1</guid> <description> <pre class="wiki">Logged In: YES user_id=637229 v 1.34 has introduced breaking changes for boost::ptr_map. Please see the new documentation for details. -Thorsten </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>Marshall Clow</dc:creator> <pubDate>Tue, 21 Aug 2007 21:08:55 GMT</pubDate> <title>status, component, description changed; severity set https://svn.boost.org/trac10/ticket/730#comment:2 https://svn.boost.org/trac10/ticket/730#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">new</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">ptr_container</span> </li> <li><strong>description</strong> modified (<a href="/trac10/ticket/730?action=diff&amp;version=2">diff</a>) </li> <li><strong>severity</strong> → <span class="trac-field-new">Problem</span> </li> </ul> Ticket Thorsten Ottosen Wed, 24 Oct 2007 15:13:00 GMT status, resolution changed https://svn.boost.org/trac10/ticket/730#comment:3 https://svn.boost.org/trac10/ticket/730#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-old">Rejected</span> → <span class="trac-field-new">wontfix</span> </li> </ul> Ticket