[C++-sig] Re: Making copy of function derived from C++ pure virtual function

Paul F. Kunz Paul_Kunz at slac.stanford.edu
Thu Dec 9 18:45:20 CET 2004


I'm stuck with the first function suggested by Dave.   I have...

template <class T>
object
FunctionWrap::
get_owner(T* me)
{
      // Use secret interface to get the Python object
      // that owns *this.  I guess I will have to make that
      // interface public.
      return
object ( handle<> ( borrowed ( detail::wrapper_base_::get_owner(this))));
}

and get...

g++ -DQT_THREAD_SUPPORT -DHAVE_CONFIG_H -I. -I../../hippodraw/python -I.. -I../../hippodraw -I../../hippodraw/qt -I.. -I../qt -I/usr/local/include -I/usr/local/include/boost-1_32 -ftemplate-depth-120 -I/usr/local/include/python2.4 -I/usr/local/qt/include -g -O2 -Wall -c ../../hippodraw/python/FunctionWrap.cxx -MT FunctionWrap.lo -MD -MP -MF .deps/FunctionWrap.TPlo  -fPIC -DPIC
../../hippodraw/python/FunctionWrap.cxx: In member function `boost::python::api::object FunctionWrap::get_owner(T*)':
../../hippodraw/python/FunctionWrap.cxx:86: error: invalid initialization of reference of type 'const volatile boost::python::detail::wrapper_base&' from expression of type 'FunctionWrap* const'
/usr/local/include/boost-1_32/boost/python/detail/wrapper_base.hpp:72: error: in passing argument 1 of `PyObject* boost::python::detail::wrapper_base_::get_owner(const volatile boost::python::detail::wrapper_base&)'
../../hippodraw/python/FunctionWrap.cxx:86: error: no matching function for call to `borrowed(<type error>)'
make[2]: *** [FunctionWrap.lo] Error 1

Compiler is gcc 3.4.3 on Red Hat 9 Linux.   I've looked at the
wrapper_base.hpp file, but don't understand it.





More information about the Cplusplus-sig mailing list