[C++-sig] private destructor

Roman Yakovenko roman.yakovenko at gmail.com
Sun Oct 15 08:34:48 CEST 2006


On 10/11/06, Monty Taylor <monty at inaugust.com> wrote:
> Hi all,
>
> I've got a class with a private destructor. So I marked it no_init:
>
>   class_<NdbTransaction>("NdbTransaction",no_init);
>
> based on a thread about what pyste should do in a similar situation.
> But I'm still getting:

Try Py++. It handles such situation well :-)

For the next class
struct X{
    int i;
private:
    ~X(){}
};

Py++ generates next code:

    bp::class_< X, boost::noncopyable >( "X", bp::no_init )
        .def_readwrite( "i", &X::i );

Take a look on Py++ GUI - you don't have to learn any API.
http://language-binding.net/pyplusplus/documentation/tutorials/tutorials.html#graphical-interface

-- 
Roman Yakovenko
C++ Python language binding
http://www.language-binding.net/



More information about the Cplusplus-sig mailing list