Boost C++ Libraries: Ticket #5757: boost::property_tree::ptree_bad_data::data<T>() should be const https://svn.boost.org/trac10/ticket/5757 <p> The following won't compile </p> <blockquote> <p> try { /*...*/ } </p> </blockquote> <blockquote> <p> catch( const boost::property_tree::ptree_bad_data &amp;e ) </p> </blockquote> <blockquote> <p> { std::cout &lt;&lt; e.data&lt;std::string&gt;(); } </p> </blockquote> <p> as the relevant member function template is not const. Additionally, I think the documentation should give a reminder or a hint that a template parameter is necessary, and why this is the case. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/5757 Trac 1.4.3 Sebastian Redl Fri, 13 Jan 2012 12:20:43 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/5757#comment:1 https://svn.boost.org/trac10/ticket/5757#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