(resent) sorry had to compress the patch, the original email is stuck in the moderator's queue...<br><div class="gmail_quote"><br><br>Hi all,<br><br>I'll continue this email thread... attached is a smallish patch (I'm not familiar with git so I started smallish). It removes all the method specifiers that say throw()... eg<br>
<br>void do_something throw() { }<br>
<br>The throw() things are not desirable as kdtree should be exception transparent... the throw()s caused problems with my program, as sometimes accessors could throw an exception - and the no-throw guarantee that kdtree was imposing prevented it from compiling.<br>
<br>I also had trouble compiling kdtree for a visual c++ 2005 program, because (IIRC) of the use of GCC's __throw_exception_again extension.<br><br>Instead, I switched to a class-destructor pattern (I forget the patterns name) which basically uses a class to manage the lifetime of the pointer...<br>
<br>_Link_type _M_new_node( etc)<br>{<br> typename _Base::NoLeakAlloc noleak(this); <-- see allocator.hpp for definition. this allocs memory<br> _Link_type new_node = noleak.get(); <-- just get the pointer from noleak<br>
_M_construct_node(new_node, __V, __PARENT, __LEFT, __RIGHT); <-- do the thing that could throw an exception<br> noleak.disconnect(); <--- if we are here, then all went well. call this function that stops noleak from deallocating on destruction<br>
return new_node;<br>}<br><br>else if construct_node threw an exception, noleak's destructor would automatically dealloc the node.<br><br><br><br>I also extended the 'examples' Makefile so it'll try compiling it with gcc 3.4, 4.2 and 4.3 (run make all_gcc). I corrected a minor problem in the test file (missing include file).<br>
<br><br>Note that I have a bunch more changes to work through, but I need to merge the changes from the trunk into mine first... so I thought I'd start with this throw() task. BUT that means I haven't tested out kdtree on my application, so if people could please test out this patch, reject or accept it, that would be great.<br>
<br>cheers<br>Paul<br><br><br><div class="gmail_quote">2008/10/26 Paul Harris <span dir="ltr"><<a href="mailto:paulharris@computer.org" target="_blank">paulharris@computer.org</a>></span><div><div></div><div class="Wj3C7c">
<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I agree, it is time to revise naming. I did some revision on my local version but with less underscores.<br><br>I suggest we make small changes (such as this patch) to libkdtree for debian's release packaging for the moment since Lenny needs to stablise very soon, and I'll see if we can get the ball rolling on merging in bigger changes for 0.7.0<br>
<br>I'll have a quick look now to see if there are any other small changes from my local version that I can bring in to <a href="http://0.6.3." target="_blank">0.6.3.</a>..<br><br><div class="gmail_quote">2008/10/25 martin f krafft <span dir="ltr"><<a href="mailto:madduck@debian.org" target="_blank">madduck@debian.org</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div>also sprach Martin SCHREIBER <<a href="mailto:martin.schreiber@in.tum.de" target="_blank">martin.schreiber@in.tum.de</a>> [2008.10.25.0404 +0200]:<br>
<div>> is it possible that you patch the git sources and create a new<br>
> version 0.6.3?<br>
<br>
</div>Even though the patch might well work, it strikes me as hackish.<br>
Maybe it's time to revise the naming completely?<br>
<br>
Cheers,<br>
<br>
--<br>
.''`. martin f. krafft <<a href="mailto:madduck@debian.org" target="_blank">madduck@debian.org</a>><br>
: :' : proud Debian developer, author, administrator, and user<br>
`. `'` <a href="http://people.debian.org/%7Emadduck" target="_blank">http://people.debian.org/~madduck</a> - <a href="http://debiansystem.info" target="_blank">http://debiansystem.info</a><br>
`- Debian - when you have better things to do than fixing systems<br>
<br>
in africa some of the native tribes have a custom of beating the<br>
ground with clubs and uttering spine chilling cries. anthropologists<br>
call this a form of primitive self-expression. in america they call<br>
it golf.<br>
<br></div></div>-----BEGIN PGP SIGNATURE-----<br>
Version: GnuPG v1.4.9 (GNU/Linux)<br>
<br>
iEYEARECAAYFAkkC9boACgkQIgvIgzMMSnVUTgCghHcFfomXpiBsUyCOLFKFvNVc<br>
/BEAn1PVy1F2qgXqYQanTpn+VCPBBSt2<br>
=DBLS<br>
-----END PGP SIGNATURE-----<br>
<br>_______________________________________________<br>
libkdtree-devel mailing list<br>
<a href="mailto:libkdtree-devel@lists.alioth.debian.org" target="_blank">libkdtree-devel@lists.alioth.debian.org</a><br>
<a href="http://lists.alioth.debian.org/mailman/listinfo/libkdtree-devel" target="_blank">http://lists.alioth.debian.org/mailman/listinfo/libkdtree-devel</a><br>
<br></blockquote></div><br>
</blockquote></div></div></div><br>
</div><br>