>>>>> "Hyrum K. Wright" <hyrum_wri...@mail.utexas.edu>:

> This is an interesting approach...and parallels what has already been
> done. :)

> Out of curiosity, have you taken a chance to look at the
> existing code here:
> http://svn.apache.org/repos/asf/subversion/branches/object-model/subversion/bindings/c++/include/Types.h
> ? 

Looking at it now.

> Of particular interest are the RefCounter and CStructWrapper classes.

Hm... personally I would have gone for a non-templatized solution.  More
classes (the classes I spelled out, you create by instantiating
templates), perhaps, and more code.  But IMO higher readability.

But it's a personal choice thing, and not an argument against.

I'm divided on whether I would move the delete of the RefCounter object
into the dec_ref method, or leave it where it is.  On one hand it feels
like good encapsulation to put it together with the dec_ref, on the
other hand, I've always been wary of "delete this;"...

So leaving the delete where it is is probably a good choice. :-)

Other than that it looks good to me (with the caveat that I haven't
actually tried using it, and that's when you know whether an API is good
or not).


Reply via email to