[C++-sig] GCC 3.2 side-effect?
David Abrahams
dave at boost-consulting.com
Sat Dec 21 01:20:59 CET 2002
"William Trenker" <wtrenker at hotmail.com> writes:
> The following code fragment compiled without error yesterday with GCC
> 2.95.3.
>
> handle<> h_result;
> ...
> h_result = PyRun_String(
> "import time\n",
> Py_file_input, main_namespace.get(), main_namespace.get()
> );
> ...
>
> Today I upgraded to GCC 3.2. I was able to re-build boost.python
> without error, although a number of warnings popped up that weren't
> there with the older compiler.
>
> But the code fragment above, taken from a small project I'm working
> on, gives the following errror:
>
> cm.cpp:28: no match for `boost::python::handle<PyObject>& = PyObject*'
> operator
> /root/cvsroot/boost/boost/python/handle.hpp:193: candidates are:
> boost::python::handle<T>& boost::python::handle<T>::operator=(const
> boost::python::handle<T>&) [with T = PyObject]
>
> What is missing in my code?
The handle<> constructor is explicit.
h_result = handle<>(PyRun_String(...));
--
David Abrahams
dave at boost-consulting.com * http://www.boost-consulting.com
Boost support, enhancements, training, and commercial distribution
More information about the Cplusplus-sig
mailing list