|
Boost : |
From: David Abrahams (abrahams_at_[hidden])
Date: 2001-05-15 07:53:13
You might also try splitting the classes which generate these friend
functions into levels of inheritance corresponding to the dependencies
between the friend functions: the base classes would generate the
from_python functions which had to be used by derived classes. I don't know
whether this works or whether it is too much work...
-Dave
----- Original Message -----
From: <rwgk_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Monday, May 14, 2001 10:13 PM
Subject: [boost] Re: Boost.Python compilation problem with latest Compaq
comiler
> Thanks David, your suggestion actually works!
>
> Unfortunately, the same problem keeps creeping up with
> many other friend functions (e.g. all from_python).
> Adding function declarations all over the place does
> not seem to be a viable option to me. The source code would get
> really cluttered. Instead I will try to file a bug report.
> Hopefully this problem will get fixed in the next release.
>
> Thanks!
> Ralf
>
> --- In boost_at_y..., "David Abrahams" <abrahams_at_m...> wrote:
> > Hi Ralf,
> >
> > You might try adding some function declarations in the calling
> functions,
> > e.g.:
> >
> > friend T* from_python(PyObject* obj, boost::python::type<T*>)
> > {
> > T* non_null_from_python(PyObject*, boost::python::type<T*>);
> > if (obj == Py_None)
> > return 0;
> > else
> > return non_null_from_python(obj, boost::python::type<T*>
> ());
> > }
> > ...
> > // Convert to T&
> > friend T& from_python(PyObject* p, boost::python::type<T&>)
> > { T* non_null_from_python(PyObject*,
> boost::python::type<T*>);
> > return
> > *boost::python::detail::check_non_null(non_null_from_python(p,
> > boost::python::type<T*>())); }
> >
> > Best of luck,
> > Dave
>
>
>
> To unsubscribe, send email to: <mailto:boost-unsubscribe_at_[hidden]>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk