Boost logo

Boost :

From: conversy_at_[hidden]
Date: 2001-08-31 06:42:37


Hello.

Taking the file
boost/libs/python/example/abstract.cpp

I tweaked it to reflect my own classes.
I added a constructor that takes a float:

struct Abstract {
  Abstract(float) {}
...
};

so Abstract_callback becomes:

struct Abstract_callback: Abstract
{
    Abstract_callback(PyObject * self, float f)
    : Abstract(f), m_self(self)
    {}
...
};

and the added constructor is:

a_class.def(boost::python::constructor<float>()); // wrap a
constructor.

using g++-3.0.1, it segfaults. Is it a bug, or did I miss something ?

btw, it works if Abstract_callback is:

struct Abstract_callback: Abstract
{
Abstract_callback(PyObject * self)
: Abstract(.1), m_self(self)
{}
...
};

and the constructor is the same than in the original example.

thanks.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk