node is whatever you store in the tree...<br><br>so in this case its pretty easy<br><br>
struct not_me<br>
{<br>shared_ptr&lt;A&gt; me;<br>&nbsp;not_me(shared_ptr&lt;A&gt; m) : me(m) {}<br><br>
 &nbsp;bool operator()( shared_ptr&lt;A&gt; const&amp; n ) const { return n != me; }<br>
};<br>
<br><br><div class="gmail_quote">2008/7/11 Gonsolo &lt;<a href="mailto:gonsolo@gmail.com">gonsolo@gmail.com</a>&gt;:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi!<br>
<br>
Paul Harris schrieb:<div class="Ih2E3d"><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I use a find_nearest_if() call, and pass a functor that confirms that the<br>
node is NOT the target node.<br>
<br>
eg, you could check it against a pointer, or in this case an ID.<br>
you have to be careful with the pointer approach as you have to be careful<br>
to find the right pointer (the address of the node that is stored in the<br>
tree) ...<br>
<br>
eg with id<br>
struct not_me<br>
{<br>
 &nbsp;int id;<br>
 &nbsp;not_me(int id) : id(id) {}<br>
 &nbsp;bool operator()( Node const&amp; n ) const { return <a href="http://n.id" target="_blank">n.id</a> != id; }<br>
};<br>
<br>
found = kdtree.find_nearest_if( ... , not_me(<a href="http://target.id" target="_blank">target.id</a>) );<br>
</blockquote>
<br></div>
Thank you very much. I tried that but I still do not get it.<br>
What is that Node? In kdtree&#39;s source I find _Node.<br>
<br>
I have something like:<br>
<br>
class A {};<br>
<br>
typedef KDTree::KDTree&lt;3, boost::shared_ptr&lt;A&gt;, std::pointer_to_binary_function&lt; shared_ptr&lt;A&gt;,int,double&gt; &gt; kdtree;<br><font color="#888888">
<br>
g<br>
</font></blockquote></div><br>