[C++-sig] Pyste and overloaded virtual functions.
Nicodemus
nicodemus at globalite.com.br
Sat Jul 5 00:50:38 CEST 2003
Prabhu Ramachandran wrote:
>Hi,
>
>Sorry to bother you like this every few hours but I've found another
>bug with Pyste (previous version) when generating code for overloaded
>virtual functions. Here is a test program.
>
>// ---------- overload.hpp ----------
>namespace test {
>class Base {
>public:
> virtual void f(const int i) = 0;
>};
>
>class A : public Base{
>public:
> void f(const int i) {}
> void f(const double d, const int i) {}
>};
>}
>// --------------------
>
><snip error>
>The generated code segment for the function looks like this:
>
> .def("f", &test::A::f, &test_A_Wrapper::default_f)
> .def("f", (void (test::A::*)(const double, const int) )&test::A::f)
>
>The fix is to replace it like so:
>
> .def("f", (void (test::A::*)(const int) ) &test::A::f, &test_A_Wrapper::default_f)
> .def("f", (void (test::A::*)(const double, const int) )&test::A::f)
>
>Only the first line is changed. I've also attached a patch to
>ClassExporter.py that fixes this for me. Oh! I just spent an hour
>and a half debugging this but it looks like this was fixed in the
>latest version that has the _name bug. FWIW, I've attached the patch
>anyway but this patch is for the ClassExporter.py version 1.29.
>
>
Yeah, it is fixed in the new version, but thanks for the patch anyway! 8)
Regards,
Nicodemus.
More information about the Cplusplus-sig
mailing list