[C++-sig] functions whose return type is a pointer
Ralf W. Grosse-Kunstleve
rwgk at yahoo.com
Wed Jan 22 15:55:40 CET 2003
--- Beetle <BeetleHoHo at hotmail.com> wrote:
> If I do this :
> >>> a = A()
> >>> px = a.getAttributeX()
> what is the data type of px anyway, or I simply can't do this kind of
> wrapping ?
You can, but you have to deal with life-time issues explicitly. This is
explained very nicely in the tutorial:
http://www.boost.org/libs/python/doc/tutorial/doc/call_policies.html
For this you will have to have a class_<B> statement also.
Ralf
P.S.: Recently there was a thread on wrapping "opaque pointers":
http://mail.python.org/pipermail/c++-sig/2003-January/003207.html
I am not sure what the current status of the corresponding patch is. Please
check the archive for the whole story if this sounds interesting.
__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
More information about the Cplusplus-sig
mailing list