on Sat Jan 17 2009, "Sebastian Walter" <walter-AT-mathematik.hu-berlin.de> 
wrote:

> Hello,
>
> I want to call a Python function from C++ with an object of a C++ class
> as argument.
> The Python-function should change the argument, so changes are visible
> on the C++ side.
> Boost::Python automatically makes a copy of all the arguments that are
> passed to a callable Python object.
>
> Is there a way NOT to copy all arguments??

>
> void my_test_function(object fun_obj){
>         A a;
>         cout<<"a.x="<<a.x<<endl;
>         fun_obj(a);

          fun_obj(boost::ref(a))
                  ^^^^^^^^^^^ ^

>         cout<<"a.x="<<a.x<<endl;
> }

HTH,

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com
_______________________________________________
Cplusplus-sig mailing list
Cplusplus-sig@python.org
http://mail.python.org/mailman/listinfo/cplusplus-sig

Reply via email to