Boost C++ Libraries: Ticket #12566: rtree: equal_to ambiguous template instantiation when contain a raw pointer in pair, calling method remove https://svn.boost.org/trac10/ticket/12566 <p> Im trying to compile this example: </p> <p> main.cpp: </p> <pre class="wiki">#include &lt;boost/geometry.hpp&gt; namespace bg = boost::geometry; namespace bgi = boost::geometry::index; namespace bgm = boost::geometry::model; int main() { using Point = bgm::point&lt;double, 2, bg::cs::spherical_equatorial&lt;bg::degree&gt;&gt;; using ValueType = std::pair&lt;Point, int*&gt;; using Rtree = bgi::rtree&lt;ValueType, bgi::quadratic&lt;16&gt;&gt;; int a,b; Rtree rtree; rtree.insert(std::make_pair(Point(45,45), &amp;a)); rtree.insert(std::make_pair(Point(45,45), &amp;b)); rtree.remove(std::make_pair(Point(45,45), &amp;b)); return 0; } </pre><p> using gcc 6.2.1 and boost 1.61.0 or 1.58.0 (no problem with boost 1.52.0) </p> <p> I got folowing error: </p> <pre class="wiki">/usr/include/boost/geometry/index/equal_to.hpp:127:41: erreur : ambiguous template instantiation for ‘struct boost::geometry::index::detail::equals&lt;int*, void&gt;’ &amp;&amp; detail::equals&lt;T2&gt;::apply(l.second, r.second); ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~ /usr/include/boost/geometry/index/equal_to.hpp:28:8: note : candidats sont : template&lt;class Geometry, class Tag&gt; struct boost::geometry::index::detail::equals&lt;Geometry*, Tag&gt; [with Geometry = int; Tag = void] struct equals&lt;Geometry *, Tag&gt; ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/boost/geometry/index/equal_to.hpp:37:8: note : template&lt;class T&gt; struct boost::geometry::index::detail::equals&lt;T, void&gt; [with T = int*] struct equals&lt;T, void&gt; ^~~~~~~~~~~~~~~ /usr/include/boost/geometry/index/equal_to.hpp:127:41: erreur : incomplete type ‘boost::geometry::index::detail::equals&lt;int*, void&gt;’ used in nested name specifier &amp;&amp; detail::equals&lt;T2&gt;::apply(l.second, r.second); ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~ </pre><p> no problem if I replace int* by int </p> <p> also document here <a class="ext-link" href="http://stackoverflow.com/questions/39970131/issue-storing-raw-pointers-in-boost-r-tree"><span class="icon">​</span>http://stackoverflow.com/questions/39970131/issue-storing-raw-pointers-in-boost-r-tree</a> </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12566 Trac 1.4.3 Cédric ROYER Fri, 28 Oct 2016 09:27:49 GMT attachment set https://svn.boost.org/trac10/ticket/12566 https://svn.boost.org/trac10/ticket/12566 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">main.cpp</span> </li> </ul> <p> Error example </p> Ticket awulkiew Wed, 28 Dec 2016 02:50:47 GMT status changed; keywords, resolution set https://svn.boost.org/trac10/ticket/12566#comment:1 https://svn.boost.org/trac10/ticket/12566#comment:1 <ul> <li><strong>keywords</strong> index rtree equal_to added </li> <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> Thanks! </p> <p> Fix: <a class="ext-link" href="https://github.com/boostorg/geometry/commit/676e061978723a97180a51aeef83ae9d61fc29c3"><span class="icon">​</span>https://github.com/boostorg/geometry/commit/676e061978723a97180a51aeef83ae9d61fc29c3</a> </p> Ticket awulkiew Tue, 10 Jan 2017 23:21:28 GMT milestone changed https://svn.boost.org/trac10/ticket/12566#comment:2 https://svn.boost.org/trac10/ticket/12566#comment:2 <ul> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.64.0</span> </li> </ul> Ticket