[C++-sig] Pyste and pointers on const data

jonathan liger jonathan.liger at wanadoo.fr
Sat Dec 3 17:45:27 CET 2005


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 Export_myHeader()
| {
|     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.




More information about the Cplusplus-sig mailing list