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

Paul F. Kunz Paul_Kunz at slac.stanford.edu
Mon Dec 13 17:47:16 CET 2004


>>>>> On Sun, 12 Dec 2004 22:26:21 -0500, David Abrahams <dave at boost-consulting.com> said:

> This means some Python exception is being thrown.  You might set a
> breakpoint on boost::python::detail::throw_error_already_set (I
> think I have the namespace right) and look just up the stack to see
> what the actual error being reported is.

   Doing that, I find exception being thrown from here...

template <class T>
inline T* expect_non_null(T* x)
{
    if (x == 0)
        throw_error_already_set();
    return x;
}

x is 0.   This is result of calling...

	FunctionWrap * t = const_cast < FunctionWrap * > ( this );
	object self = get_owner ( t );

	// Find its most-derived Python class
	object my_class = self.attr("__class__");

	// call the copy ctor through Python.
	py_result = my_class(self);

This probably doesn't help, but thought I mentioned it in case it
rings a bell.



More information about the Cplusplus-sig mailing list