Boost C++ Libraries: Ticket #4140: Unable to compile code calling equal_range () members https://svn.boost.org/trac10/ticket/4140 <p> The following code </p> <pre class="wiki">#include &lt;boost/property_tree/ptree.hpp&gt; int main (int, char * []) { boost::property_tree::ptree pt; pt.equal_range (""); } </pre><p> generates the following error message using gcc-4.4.3 on 64-bit Snow Leopard: </p> <pre class="wiki">In file included from ../boost/boost/property_tree/ptree.hpp:515, from equal_range.cpp:2: ../boost/boost/property_tree/detail/ptree_implementation.hpp: In member function 'std::pair&lt;typename boost::property_tree::basic_ptree&lt;Key, Data, KeyCompare&gt;::assoc_iterator, typename boost::property_tree::basic_ptree&lt;Key, Data, KeyCompare&gt;::assoc_iterator&gt; boost::property_tree::basic_ptree&lt;Key, Data, KeyCompare&gt;::equal_range(const Key&amp;) [with Key = std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, Data = std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, KeyCompare = std::less&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt;]': equal_range.cpp:8: instantiated from here ../boost/boost/property_tree/detail/ptree_implementation.hpp:473: error: no matching function for call to 'std::pair&lt;boost::property_tree::basic_ptree&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, std::less&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt; &gt;::assoc_iterator, boost::property_tree::basic_ptree&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, std::less&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt; &gt;::assoc_iterator&gt;::pair(boost::multi_index::detail::bidir_node_iterator&lt;boost::multi_index::detail::ordered_index_node&lt;boost::multi_index::detail::index_node_base&lt;std::pair&lt;const std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, boost::property_tree::basic_ptree&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, std::less&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt; &gt; &gt;, std::allocator&lt;std::pair&lt;const std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, boost::property_tree::basic_ptree&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, std::less&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt;&amp;, boost::multi_index::detail::bidir_node_iterator&lt;boost::multi_index::detail::ordered_index_node&lt;boost::multi_index::detail::index_node_base&lt;std::pair&lt;const std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, boost::property_tree::basic_ptree&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, std::less&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt; &gt; &gt;, std::allocator&lt;std::pair&lt;const std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, boost::property_tree::basic_ptree&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, std::less&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt;&amp;)' /opt/local/include/gcc44/c++/bits/stl_pair.h:83: note: candidates are: std::pair&lt;_T1, _T2&gt;::pair(const _T1&amp;, const _T2&amp;) [with _T1 = boost::property_tree::basic_ptree&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, std::less&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt; &gt;::assoc_iterator, _T2 = boost::property_tree::basic_ptree&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, std::less&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt; &gt;::assoc_iterator] /opt/local/include/gcc44/c++/bits/stl_pair.h:79: note: std::pair&lt;_T1, _T2&gt;::pair() [with _T1 = boost::property_tree::basic_ptree&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, std::less&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt; &gt;::assoc_iterator, _T2 = boost::property_tree::basic_ptree&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, std::less&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt; &gt;::assoc_iterator] /opt/local/include/gcc44/c++/bits/stl_pair.h:68: note: std::pair&lt;boost::property_tree::basic_ptree&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, std::less&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt; &gt;::assoc_iterator, boost::property_tree::basic_ptree&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, std::less&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt; &gt;::assoc_iterator&gt;::pair(const std::pair&lt;boost::property_tree::basic_ptree&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, std::less&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt; &gt;::assoc_iterator, boost::property_tree::basic_ptree&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, std::less&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt; &gt;::assoc_iterator&gt;&amp;) </pre><p> I see similar error messages using gcc-4.0, 4.2, and 4.3 on Snow<br /> Leopard, Fedora Core 12, and RHEL 4 with Boost 1.41, 1.42, and trunk from SVN.<br /> </p> <p> Changing the argument to equal_range () to std::string("") or <br /> boost::property_tree::ptree::key_type ("") generates similar error messages. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4140 Trac 1.4.3 Sebastian Redl Tue, 27 Apr 2010 10:05:06 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/4140#comment:1 https://svn.boost.org/trac10/ticket/4140#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/61611" title="Explicitly convert some iterators. Fixes bug 4140.">[61611]</a>) Explicitly convert some iterators. Fixes bug 4140. </p> Ticket