[C++-sig] def_readwrite and custom rvalue converters

Ralf W. Grosse-Kunstleve rwgk at yahoo.com
Sun Mar 9 08:31:33 CET 2003


Hi David,

In December we had a conversation about the interaction of
def_readonly()/def_readwrite() and my custom rvalue converters
(container_conversions.h), leading to

TypeError: No Python class registered for C++ class ...

messages. After you gave me some advice I arrived at this
replacement for def_readwrite():

      typedef return_value_policy<return_by_value> rbv;
      // ...
        .add_property("site", make_getter(&w_t::site, rbv()),
                              make_setter(&w_t::site))

Is this still the best solution available?

Thanks,
        Ralf


__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/




More information about the Cplusplus-sig mailing list