[C++-sig] def() vs. add_property()

Ralf W. Grosse-Kunstleve rwgk at yahoo.com
Wed Jul 16 18:15:31 CEST 2003


--- Stefan Seefeld <stefan.seefeld at orthosoft.ca> wrote:
> However, I'd rather like to make the origin accessible
> as a (read-only) property. The problem is that the
> 'add_property' method doesn't take a return value policy,
> so I have no way of telling python how to wrap the pointer.

make_getter supports return-value policies:

        .add_property("origin", make_getter(&Event::origin,
return_value_policy<whatever>()))

Ralf


__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com




More information about the Cplusplus-sig mailing list