Dynamic dimensions

martin f krafft madduck at debian.org
Sat Mar 28 09:11:42 UTC 2009


also sprach Paul Harris <paulharris at computer.org> [2009.03.28.0920 +0100]:
> You mean an additional template parameter?

No. If you have a type like

template<int K>
class Foo {
// ...
}

then you can follow that with a definition

template<0>
class Foo {
// ...
}

which will override ("specify") the more generic template definition
with a specific one to be used whenever the template parameter is 0.

Check the syntax though, I haven't done C++ in 3 years. :)

> Not a bad idea, but that excludes those who want a template kdtree and a
> dynamic-dimensions kdtree.   I may have such a requirement in the future, if
> I add a feature where the user can choose what data to index and search.
> That tree would be dynamic, and the usual trees would be static.

Then the idea with template specification seems the right way...
unless we create a distinct type: KDTree and DDTree. K ist
a constant, D stands for dynamic.

-- 
 .''`.   martin f. krafft <madduck at d.o>      Related projects:
: :'  :  proud Debian developer               http://debiansystem.info
`. `'`   http://people.debian.org/~madduck    http://vcs-pkg.org
  `-  Debian - when you have better things to do than fixing systems
 
a c programmer asked whether computers have buddha's nature.
as the answer, the master did "rm -rf" on the programmer's home
directory. and then the c programmer became enlightened...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature (see http://martin-krafft.net/gpg/)
Url : http://lists.alioth.debian.org/pipermail/libkdtree-devel/attachments/20090328/302b0af0/attachment-0001.pgp 


More information about the libkdtree-devel mailing list