[C++-sig] custom r-value converters

Nathan Stewart swarfrat at gmail.com
Mon Mar 29 09:08:50 CEST 2010

Ok some follow up - I now rip through my exposed classes looking for
String_mgr typed properties to create custom get/setters for.Then, I set the
following for that property:

for c in classes:
    for property in c.public_members:
            if 'CustomString' in property.decl_string:
                property.set_use_make_functions( True )
                property.set_getter_call_policies( property.return_by_value
                property.set_setter_call_policies( property.return_by_value

What is generated instead looks like this

       .add_property( "name"
                        , bp::make_getter( &Update::name,
bp::return_internal_reference< >() )
                        , bp::make_setter( &Update::name ) )

when I expected it to look like:

       .add_property( "name"
                        , bp::make_getter( &Update::name,
bp::return_by_value() )
                        , bp::make_setter( &Update::namem
bp::return_by_value() ) )

It's a property, and it occurs to me that it might not be a callable object.
But I don't have one at this point - make_getter/setter is creating it. What
am I doing wrong here?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20100329/81b81e73/attachment.html>

More information about the Cplusplus-sig mailing list