|
Boost : |
From: Drew.Whitehouse_at_[hidden]
Date: 2001-10-18 23:57:13
David,
Sorry I wasn't clear in my description, I want to have non-standard
constructor/constructors for __init__/__del__ function. ie for the
example below -
a = A() # in python
would translate to underlying calls of the form
A *a = A::instantiate();
instead of
A *a = new A;
and similar for the destructor. Does this make more sense ?
-Drew
--- In boost_at_y..., "David Abrahams" <david.abrahams_at_r...> wrote:
> Drew,
>
> constructors and destructors of wrapped classes are called
automatically, so
> you don't need to override __init__ and __del__.
>
> ===================================================
> David Abrahams, C++ library designer for hire
> resume: http://users.rcn.com/abrahams/resume.html
>
> C++ Booster (http://www.boost.org)
> email: david.abrahams_at_r...
> ===================================================
>
> ----- Original Message -----
> From: <Drew.Whitehouse_at_a...>
> >
> > Is it possible to override __init__ __del__ methods so that my own
> > constructors and destructors are called ?
> >
> > eg
> >
> > class A
> > {
> > protected:
> >
> > A();
> > virtual ~A();
> >
> > public:
> >
> > A *instantiate();
static A *instantiate(); // <- should have been
> > void release();
> >
> > };
> >
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk