[C++-sig] Antwort: Re: Wrapping a base class' method

bernhard.maeder at zkb.ch bernhard.maeder at zkb.ch
Tue Nov 28 11:08:46 CET 2006



> Write a thin wrapper and .add_property that, e.g. (untested)
>
> int get_base_i_directly(my_class const& self) { return self.get_base_i();
}
> ...
> .add_property("basei", make_function(get_base_i_directly))
>
> This way Boost.Python only "sees" my_class in the signature.

Yes, thanks, that works.

What puzzles me, is that the same works for return-by-value wrappings. I
don't quite get why that's something different to boost.python. Is there an
easy explanation or am I just missing the obvious?

Thanks
Bernhard



___________________________________________________________________

Disclaimer:


Diese Mitteilung ist nur fuer die Empfaengerin / den Empfaenger bestimmt.

Fuer den Fall, dass sie von nichtberechtigten Personen empfangen wird,
bitten wir diese hoeflich, die Mitteilung an die ZKB zurueckzusenden und
anschliessend die Mitteilung mit allen Anhaengen sowie allfaellige Kopien
zu vernichten bzw. zu loeschen. Der Gebrauch der Information ist verboten.


This message is intended only for the named recipient and may contain
confidential or privileged information.

If you have received it in error, please advise the sender by return e-mail
and delete this message and any attachments. Any unauthorised use or
dissemination of this information is strictly prohibited.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20061128/2f9cd6e8/attachment.htm>


More information about the Cplusplus-sig mailing list