A question for you all: size_t or unsigned int

Paul Harris paulharris at computer.org
Thu Nov 13 13:48:31 UTC 2008


> I don't see the benefit of asking the user to include only that
> file. I am also not sure about the typedef. That's nicer and
> cleaner than a define, but I think that
>
> #ifndef KDTREE_SIZE_T
> #define KDTREE_SIZE_T unsigned int
> #endif
>
> in a header file included by all other header files, is a better way
> forward. If the user now needed to override (which we assume is the
> exception), s/he'd just
>
> #define KDTREE_SIZE_T unsigned long long
> #include <kdtree++/kdtree.hpp>
>
> If s/he doesn't #define, then the default is used.
>

good suggestion... ok done.

Hope you won't be pissed, but I'd like to follow the STL's lead and use
size_t as the default.  Plus, size_t has been what we've been using in
0.6.2.

You pointed out that platform differences may make serialization difficult
between platforms, but that is the case even for std::vectors...

Attached are 3 patches, you clone the git repo and then use "git am" to
apply each one in turn (Martin already knows this, I didn't)

The next thing to do is fix the bug shown via test_hayne, and I think i've
seen another bug in find() where it may return a random (or nearby) point
when it can't find the point at all.  I'll write a test case for it
tomorrow.

If you want to have a look, please go ahead.  If people are happy with what
i've done, i'll push it to the repository.

cheers
Paul
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.alioth.debian.org/pipermail/libkdtree-devel/attachments/20081113/1d0f15c4/attachment-0001.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Added-test_hayne-to-examples-which-demonstrates-a-bu.patch
Type: application/octet-stream
Size: 4017 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/libkdtree-devel/attachments/20081113/1d0f15c4/attachment-0003.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Added-cmake-support.-It-just-compiles-the-examples.patch
Type: application/octet-stream
Size: 8112 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/libkdtree-devel/attachments/20081113/1d0f15c4/attachment-0004.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-KDTree-now-compiles-with-MS-VC-2005-with-the-64-bit.patch
Type: application/octet-stream
Size: 28756 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/libkdtree-devel/attachments/20081113/1d0f15c4/attachment-0005.obj 


More information about the libkdtree-devel mailing list