[C++-sig] Policies again

Piotr Jaroszynski p.jaroszynski at gmail.com
Sat May 5 12:30:30 CEST 2007


On Friday 04 of May 2007 21:23:30 Roman Yakovenko wrote:
> No,  return_internal_reference should be fine. I don't remember why,
> but Py++ generates a wrapper class for you use-case and adds accessor
> function. Take a look on member variables tester. I attached the
> generated code.

Thanks a lot!
Making accessors functions did the trick. I wonder whether it can be 
considered a bug in the make_getter as using:

>     b.add_property("f", bp::make_getter(&Blah::f,
>          bp::return_internal_reference<>()));

results in:
> Traceback (most recent call last):
>   File "./test.py", line 5, in ?
>     print Blah().f
> Boost.Python.ArgumentError: Python argument types in
>     None.None(Blah)
> did not match C++ signature:
>     None(Blah_f {lvalue})

-- 
Best Regards,
Piotr Jaroszynski



More information about the Cplusplus-sig mailing list