[C++-sig] extracting a c++ object from a PyObject
by Francois Ostiguy other posts by this author
Feb 27 2003 6:47PM messages near this date
[C++-sig] Inherited instance variables
|
Re: [C++-sig] extracting a c++ object from a PyObject
This is a follow-up question to a recent thread.
Dave Abrahams provided the following code to extract a c++ object from a
PyObject
void f(PyObject* p) {
handle<> ph(borrowed(p));
MyObj* op = extract<MyObj*> (object(ph));
}
this works beautifully, but appenrently fails in the case where MyObj
is a simple function. That is
typedef void (fcntptr*)();
void f(PyObject* p) {
handle<> ph(borrowed(p));
fcntptr op = extract<fcntptr> (object(ph));
}
results in the following compilation error message.
/usr/local/include/boost/type_traits/add_cv.hpp:34: `const volatile'
qualifiers cannot be applied to `void ()()'
As always, any help/insight is greatly appreciated.
-Francois
----------------------------------------------------------------------------
Dr. Jean-Francois OSTIGUY voice: (630) 840-2231
Beam Physics Dept MS220 FAX: (630) 840-6039
Fermi National Accelerator Laboratory email: ostiguy@[...].gov
Batavia IL 60510-0500 WWW:www-ap.fnal.gov/~ostiguy
_______________________________________________
C++-sig mailing list
C++-sig@[...].org
http://mail.python.org/mailman/listinfo/c++-sig
Thread:
Francois Ostiguy
David Abrahams
|