[C++-sig] [boost.python] char arrays in structs
Markus Schöpflin
markus.schoepflin at comsoft.de
Tue Jul 5 10:08:09 CEST 2005
Ralf W. Grosse-Kunstleve wrote:
> You don't have to use inheritance just to provide a wrapper. An unbound
> function will also work if the first argument is foo& or foo const& (and maybe
> even foo* etc., I am not sure):
>
> char const*
> get_bar(foo& self) { return foo.bar(); }
>
> Then:
>
> class<foo>("foo")
> .def("get_bar", get_bar)
> ;
Yes, this works nicely. Thanks.
Markus
More information about the Cplusplus-sig
mailing list