[C++-sig] Member function bp::optional? Or workaround?
hans_meine at gmx.net
Tue Jan 12 21:09:39 CET 2010
On Dienstag 12 Januar 2010, Charles Solar wrote:
> Well I want to define the overloads myself anyway, I just do not know how
> to properly setup the small wrapper that will work.
> In the doc it tells
> you how to make flat function wrappers, but nothing on member function
I am 100% sure that they're documented, yet I am not very lucky with the docs
> I am unsure how I am supposed to handle the this pointer, for
You can reference the member function pointer like this (untested of course):
.def("bar", (void(Foo::*)(const Y*))&T::bar)
.def("bar", (void(Foo::*)(const X&,const Y*))&T::bar)
> So idealy what I would like to know is what the macro does so I can
> manually write out the wrappers myself.
> And I have tried using Py++, it does not handle the default argument, it
> just puts the call in there and python still requires the param to be
Really? AFAIK, it should work.
You should be able to write (arg("some_x"), arg("some_y") = NULL)) as
extra .def() argument.
Maybe py++ does not output the default args when the arguments are unnamed?
(I wouldn't know how, either.)
Ciao, / / .o.
/ / ANS ooo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 197 bytes
Desc: This is a digitally signed message part.
More information about the Cplusplus-sig