[zeromq-dev] Language binding guidelines

Martin Sustrik sustrik at 250bpm.com
Tue Mar 2 15:19:54 CET 2010


gonzalo diethelm wrote:

> I think the point is to have an explicit function to destroy the object,
> and ALSO call that same function from the destructor. So in C++ you
> would do:
> 
> class Foo {
>   public:
>     Foo() { /* blah */ }
>     ~Foo {destroy(); }
> 
>     void destroy() { /* blah */ }
> };
> 
> This way you can call destroy() whenever you want, and it will be called
> for you automatically when the object's destructor is called.

Yes, sure. What I was saying was that in C++ it is not really needed as 
you can achieve the same effect using dynamic allocation (new/delete). 
If in the future anyone is able to provide a use case that *really* 
requires this kind of thing, it's trivial to add it. (On the other hand 
it's never trivial to remove a function from API as it makes backward 
compatibility go south.)

Martin





More information about the zeromq-dev mailing list