<br><br><div class="gmail_quote">2009/3/28 martin f krafft <span dir="ltr">&lt;<a href="mailto:madduck@debian.org">madduck@debian.org</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

also sprach Willi Richert &lt;<a href="mailto:w.richert@gmx.net">w.richert@gmx.net</a>&gt; [2009.03.28.0004 +0100]:<br>
<div class="im">&gt; It is needed so that bindings with dynamic typing (Python) don&#39;t<br>
&gt; have to instantiate each possible dim x type combination. The<br>
&gt; dimension is only specified once at the constructor.<br>
<br>
</div>That change sacrifices all the type-safety of C++ though. Now all of<br>
a sudden, a 3D-tree is of the same type as a 4D-tree. I don&#39;t like<br>
it. There must be a better way for swig to handle this, isn&#39;t there?<br>
<br>
Anyway, I am not developing anymore, so feel free to ignore what<br>
I have to say...<br>
<font color="#888888"></font></blockquote><div><br>I agree with Martin, and I was also wondering if there was a way to avoid breaking all the user&#39;s code that has a number in the template.<br><br>So, Willi, would it be possible to adjust your patch so that IF the N template parameter is zero, only THEN does it morph kdtree into a dynamic-dimensions tree ? ie Ignore the constructor parameter unless N=0<br>

<br>I don&#39;t really like that solution either, as it relies on reusing N for a different purpose.  What if someone wants to detect errors where their program is trying to create a zero-dimension tree (possible when users create additional templated layers around kdtree).<br>

<br>Maybe we should add a new template... bool dynamic_N or something like that.<br><br>cheers<br>Paul<br><br></div></div>