[prev in list] [next in list] [prev in thread] [next in thread]
List: python-cpp-sig
Subject: Re: [C++-sig] Member function bp::optional? Or workaround?
From: Hans Meine <hans_meine () gmx ! net>
Date: 2010-01-12 20:09:39
Message-ID: 201001122109.40705.hans_meine () gmx ! net
[Download RAW message or body]
[Attachment #2 (multipart/signed)]
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.
Oh, OK.
> In the doc it tells
> you how to make flat function wrappers, but nothing on member function
> wrappers.
I am 100% sure that they're documented, yet I am not very lucky with the docs
either.
> I am unsure how I am supposed to handle the this pointer, for
> example.
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
> there.
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.
/--/ ..o
/ / ANS ooo
["signature.asc" (application/pgp-signature)]
_______________________________________________
Cplusplus-sig mailing list
Cplusplus-sig@python.org
http://mail.python.org/mailman/listinfo/cplusplus-sig
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic