[C++-sig] Pyste and pointers on const data (original) (raw)
jonathan liger jonathan.liger at wanadoo.fr
Sat Dec 3 17:45:27 CET 2005
- Previous message: [C++-sig] working around the non-const Python C API
- Next message: [C++-sig] wrapping abstract classes question
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I found something odd using pyste :
From the header myHeader.h
| class A | { | public: | void f(); | void f(const int* const arg); | };
and the corresponding interface file
| Class("A", "myHeader.h")
Pyste generates the following wrapper code
| void ExportmyHeader() | { | boost::python::class< A >("A", boost::python::init< >()) | .def(boost::python::init< const A& >()) | .def("f", (void (A::*)() )&A::f) | .def("f", (void (A::)(const int) )&A::f) | ; | }
This problem is that A::f(const int* const) can not be casted into void(A::)(const int) (the second const is missing). This problem seems to come from Pyste itself as the xml description generated by gccxml is correct (leads to a const pointer on a const int).
_john.
- Previous message: [C++-sig] working around the non-const Python C API
- Next message: [C++-sig] wrapping abstract classes question
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]