Boost C++ Libraries: Ticket #5710: ptree::sort() compilation error https://svn.boost.org/trac10/ticket/5710 <p> It is an error code: </p> <pre class="wiki">boost::property_tree::ptree pt; pt.sort(); </pre><p> Output (VC9): </p> <pre class="wiki">c:\program files\microsoft visual studio 9.0\vc\include\utility(103) : error C2784: 'bool std::operator &lt;(const std::basic_string&lt;_Elem,_Traits,_Alloc&gt; &amp;,const _Elem *)' : could not deduce template argument for 'const std::basic_string&lt;_Elem,_Traits,_Alloc&gt; &amp;' from 'const boost::property_tree::basic_ptree&lt;Key,Data&gt;' with [ Key=std::string, Data=std::string ] c:\program files\microsoft visual studio 9.0\vc\include\string(150) : see declaration of 'std::operator &lt;' c:\program files\microsoft visual studio 9.0\vc\include\functional(143) : see reference to class template instantiation 'bool std::operator &lt;&lt;const Key,boost::property_tree::basic_ptree&lt;Key,Data&gt;&gt;(const std::pair&lt;_Ty1,_Ty2&gt; &amp;,const std::pair&lt;_Ty1,_Ty2&gt; &amp;)' being compiled with [ Key=std::string, Data=std::string, _Ty1=const std::string, _Ty2=boost::property_tree::basic_ptree&lt;std::string,std::string&gt; ] c:\program files\microsoft visual studio 9.0\vc\include\functional(142): while compiling class template member function 'bool std::less&lt;_Ty&gt;::operator ()(const _Ty &amp;,const _Ty &amp;) const' being compiled with [ _Ty=std::pair&lt;const std::string,boost::property_tree::basic_ptree&lt;std::string,std::string&gt;&gt; ] ... </pre><p> No-argument ptree::sort() in the element less&lt;pair&lt;const string, ptree&gt; &gt; to be compared by. </p> <p> However, this comparison operators are not defined. Therefore be a compilation error. </p> <p> I think, the no-argument ptree::sort() should implemented by a comparison of key strings. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/5710 Trac 1.4.3 Sebastian Redl Fri, 13 Jan 2012 12:20:43 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/5710#comment:1 https://svn.boost.org/trac10/ticket/5710#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> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/76447" title="Merge [72000],[72001],[72003], [74691], [75587], [75589], [75590], and ...">[76447]</a>) Merge <a class="changeset" href="https://svn.boost.org/trac10/changeset/72000" title="Make PTree XML writer escape attribute values.">[72000]</a>,<a class="changeset" href="https://svn.boost.org/trac10/changeset/72001" title="Allow nuls in PTree XML. See bug 5259.">[72001]</a>,<a class="changeset" href="https://svn.boost.org/trac10/changeset/72003" title="Try to work around MSVC name lookup bug. See bug 5281.">[72003]</a>, <a class="changeset" href="https://svn.boost.org/trac10/changeset/74691" title="Use boost::swap for swapping PTree's data member. Makes it possible to ...">[74691]</a>, <a class="changeset" href="https://svn.boost.org/trac10/changeset/75587" title="Give string_path an accessor for the separator.">[75587]</a>, <a class="changeset" href="https://svn.boost.org/trac10/changeset/75589" title="Make ptree_bad_data::data() and ptree_bad_path::path() const. See bug ...">[75589]</a>, <a class="changeset" href="https://svn.boost.org/trac10/changeset/75590" title="Suppress the MSVC insecure warning when compiling tests. Make ...">[75590]</a>, and <a class="changeset" href="https://svn.boost.org/trac10/changeset/75593" title="Improve pair member bug workaround: should now hopefully work with ...">[75593]</a> from trunk. Fixes bug 4840. Fixes bug 5259. Fixes bug 5281, I think. Fixes bug 5944. Fixes bug 5757. Fixes bug 5710. Fixes bug 5307, I think. </p> Ticket anonymous Wed, 18 Jan 2012 00:03:54 GMT <link>https://svn.boost.org/trac10/ticket/5710#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5710#comment:2</guid> <description> <p> I have this problem with Boost 1.48.0. Was this really fixed? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Sebastian Redl</dc:creator> <pubDate>Wed, 18 Jan 2012 00:33:43 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5710#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5710#comment:3</guid> <description> <p> I changed it to fixed 5 days ago. 1.48 was released two months ago. Do the math. </p> </description> <category>Ticket</category> </item> </channel> </rss>