[C++-sig] Wrapping functions that return a raw pointer

2009-05-02 Thread hessiess
How can I wrap a function which returns a raw pointer? for example the following generates tonnes of errors on compile: struct test { int *get() { return new int(1); } }; BOOST_PYTHON_MODULE(test) { using namespace boost::python; class_("test") .def("get", &te

Re: [C++-sig] Wrapping functions that return a raw pointer

2009-05-05 Thread hessiess
Thanks > take a look in this documentation about return police and > ResultConverterGenerator. > > > http://www.boost.org/doc/libs/1_39_0/libs/python/doc/v2/reference.html#models_of_call_policies > > For this specific case you can use this one: > http://www.boost.org/doc/libs/1_39_0/libs/python/doc

[C++-sig] Derived classes problem

2009-05-29 Thread hessiess
I am trying to create a python wrapper for the quad-ren graphics engine, which relies heavily on derived classes. The problem is that I cannot create derived classes in python and pass them to the C++ objects without getting the following error: Traceback (most recent call last): File "test.py",