Boost C++ Libraries: Ticket #13565: Compilation issue with property_tree on VS2017 15.7 https://svn.boost.org/trac10/ticket/13565 <p> The new Visual Studio 2017 15.7 with following compiler settings: </p> <p> Conformance mode: Yes(/permissive-) C++ Language Standard: ISO C++17 Standard (/std:c++17) </p> <p> generates following error: </p> <p> Error C3203 'iterator': unspecialized class template can't be used as a template argument for template parameter 'Iterator', expected a real type </p> <blockquote> <p> : public boost::reverse_iterator&lt;iterator&gt; </p> </blockquote> <p> during the compilation of the following code: </p> <blockquote> <p> std::string value = { "[GENERAL]\n" </p> <blockquote> <p> "<a class="missing wiki">MyValue</a>=42" }; </p> </blockquote> </blockquote> <p> </p> <blockquote> <p> namespace bpt = boost::property_tree; bpt::ptree tree; try { </p> <blockquote> <p> std::istringstream input(value); bpt::read_ini(input, tree); <em> Parse the INI-File into the property tree. </em></p> </blockquote> <p> } catch (...) { } </p> </blockquote> <blockquote> <p> int const v = tree.get&lt;int&gt;("GENERAL.<a class="missing wiki">MyValue</a>", 0); </p> </blockquote> <p> It looks like it has something todo with the deprecation of std::iterator in C++17. In case the Conformance mode is switched to "No", the code compiles without any errors. It is also dependent on project configuration and include order, since my first try to create an isolated project for demonstration didn't resulted in the same error. But I didn't invest much time for it. </p> <p> Here is my proposal for the solution of the issue: Prefix the template parameter to make them fully qualified. </p> <p> Change lines 112 and 122: </p> <blockquote> <p> class basic_ptree&lt;K, D, C&gt;::reverse_iterator </p> <blockquote> <p> : public boost::reverse_iterator&lt;iterator&gt; </p> </blockquote> </blockquote> <p> and </p> <blockquote> <p> class basic_ptree&lt;K, D, C&gt;::const_reverse_iterator </p> <blockquote> <p> : public boost::reverse_iterator&lt;const_iterator&gt; </p> </blockquote> </blockquote> <p> to: </p> <blockquote> <p> class basic_ptree&lt;K, D, C&gt;::reverse_iterator </p> <blockquote> <p> : public boost::reverse_iterator&lt;basic_ptree&lt;K, D, C&gt;::iterator&gt; </p> </blockquote> </blockquote> <p> and </p> <blockquote> <p> class basic_ptree&lt;K, D, C&gt;::const_reverse_iterator </p> <blockquote> <p> : public boost::reverse_iterator&lt;basic_ptree&lt;K, D, C&gt;::const_iterator&gt; </p> </blockquote> </blockquote> <p> This resolves the issue on my side. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/13565 Trac 1.4.3 Pavel Pokutnev <pavel.pokutnev@…> Tue, 15 May 2018 10:06:40 GMT attachment set https://svn.boost.org/trac10/ticket/13565 https://svn.boost.org/trac10/ticket/13565 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">ptree_implementation.hpp</span> </li> </ul> Ticket Pavel Pokutnev <pavel.pokutnev@…> Tue, 15 May 2018 11:05:16 GMT <link>https://svn.boost.org/trac10/ticket/13565#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/13565#comment:1</guid> <description> <p> Here is the corresponding pull request: <a class="ext-link" href="https://github.com/boostorg/property_tree/pull/32"><span class="icon">​</span>https://github.com/boostorg/property_tree/pull/32</a> </p> </description> <category>Ticket</category> </item> <item> <author>Pavel Pokutnev <pavel.pokutnev@…></author> <pubDate>Tue, 15 May 2018 11:59:32 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/13565#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/13565#comment:2</guid> <description> <p> Just tested the new code with older compiler version VS 2017 15.4.1. It generates following error during the compilation: </p> <p> error C2923: 'boost::iterators::reverse_iterator': 'boost::property_tree::basic_ptree&lt;K,D,C&gt;::iterator' is not a valid template type argument for parameter 'Iterator' 1&gt; : public boost::reverse_iterator&lt;basic_ptree&lt;K, D, C&gt;::iterator&gt; </p> <p> Looks I need to prefix it with 'typename'! </p> </description> <category>Ticket</category> </item> </channel> </rss>