[C++-sig] Foo to FooWrapper

Piotr Jaroszynski p.jaroszynski at gmail.com
Tue Mar 27 18:23:11 CEST 2007


Hello,

I suppose the code will show my problem better then myself, so:
http://dev.gentooexperimental.org/~peper/boost/test.cc
$ g++ -fPIC -shared -lboost_python -I/usr/include/python2.4 test.cc -o test.so

and in python:

>>> import test
>>> test.getFoo().blah()
0
>>> test.getFoo().blah1()
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
Boost.Python.ArgumentError: Python argument types in
    Foo.blah1(Foo)
did not match C++ signature:
    blah1(FooWrapper {lvalue})

How can I fix that? Making a copy-ctor for Foo is a no option. I thought about 
using shared_ptr<Foo> copy-ctor but how?

-- 
Best Regards,
Piotr Jaroszynski



More information about the Cplusplus-sig mailing list