boost.python - Virtual Functions with Default Implementations

David Abrahams dave at boost-consulting.com
Thu Apr 24 22:50:43 EDT 2003


sam at insidegabriel.com (Sam) writes:

> I'm trying to get virtual functions with default implementations to be
> exposed to Python.  When I follow the examples given on the boost.org
> site...
> http://www.boost.org/libs/python/doc/tutorial/doc/virtual_functions_with_default_implementations.html
>
> ...I get the following error:
> c:\projects\publiclibs\boost\boost_1_29_0\boost\python\detail\def_helper.hpp(131)
> : error C2440: 'return' : cannot convert from 'int (__thiscall
> giPython::BaseWrap::*const )(void)' to 'const char *'
>         There is no context in which this conversion is possible
>         c:\projects\publiclibs\boost\boost_1_29_0\boost\python\detail\def_helper.hpp(130)
> : while compiling class-template member function 'const char
> *__thiscall boost::python::detail::def_helper<int (__thiscall
> giPython::BaseWrap::*)(void),struct
> boost::python::detail::not_specified,struct
> boost::python::detail::not_specified>::doc(void) const'
>
> Anyone have any ideas?  Here is my code:

Yeah, I'm pretty sure the tutorial page you're looking at is only
valid for Boost 1.30.0, and you're using 1.29.0.  Check out the
tutorial pages in your Boost installation
($BOOST_ROOT/libs/python/doc) and see if they give the same
instructions...

BTW, I suggest you post Boost.Python questions to the C++-sig:
http://www.python.org/sigs/c++-sig/

HTH,
-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com




More information about the Python-list mailing list