I have a toy app that is storing a set&lt;&gt; of pointers to a PlanePoint object, itself little more than a wrapper for {int x, y;}. <br><br>Since I am storing pointers I want to store pointers in my KDTree too. With that in mind, I wrote this: <br>
<br>//header PlanePoint.h: <br>class PlanePoint : blah blah .. <br><br>inline bool operator==(PlanePoint const * A, PlanePoint const * B);<br><br>//header main.cpp:<br>#include &quot;PlanePoint.h&quot;<br>typedef KDTree::KDTree&lt;2, PlanePoint*, std::pointer_to_binary_function&lt;PlanePoint*, int, double&gt; &gt; tree_type_ptr;<br>
<br>When I make I get this:<br>PlanePoint.h:24: error: 'bool operator==(const PlanePoint*, const PlanePoint*)' must have an argument of class or enumerated type<br>PlanePoint.cpp:16: error: 'bool operator==(const PlanePoint*, const PlanePoint*)' must have an argument of class or enumerated type<br>
<br>This is apparently rooted in some obscure C++&nbsp; - ism to the effect that you can&#39;t define operators for pointers, or some such thing. <br><br>What I want to know is, do we have a workaround? I could just make copies of my object in the kdtree but would like to avoid that if at all possible. <br>
<br>Thanks<br><br>Eric<br><br>