Boost C++ Libraries: Ticket #12372: property_tree::get_optional without the template parameter https://svn.boost.org/trac10/ticket/12372 <p> Is it possible to call </p> <p> tree.get_optional&lt;Data&gt;(path) without the &lt;Data&gt; ? Note that Data is the type of the tree's Data. </p> <p> Would also be nice to be able to get the data as a pointer so that data can be updated in-place instead of get/push. </p> <p> Like this, implemented as a free function (for the non-const variant): </p> <p> Data * get_dataptr_optional( Tree &amp; tree, string const&amp; path ) { </p> <blockquote> <p> if (optional&lt;Tree &amp;&gt; node = tree.get_child_optional(path)) </p> <blockquote> <p> return &amp;node-&gt;data(); </p> </blockquote> <p> return NULL; </p> </blockquote> <p> } </p> <p> cheers, Paul </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12372 Trac 1.4.3