2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-22 05:22:45 +00:00

Initial attempt to fix problems

[SVN r10158]
This commit is contained in:
Dave Abrahams
2001-05-19 23:29:04 +00:00
parent 9261e2a3d9
commit 4d3079293d
26 changed files with 339 additions and 316 deletions

View File

@@ -65,9 +65,9 @@ wrapped <code>T</code>, you may want to provide an automatic
thin wrappers. You can do this simply as follows:
<blockquote><pre>
BOOST_PYTHON_BEGIN_CONVERSION_NAMESPACE // this is a gcc 2.95.2 bug workaround
PyObject* to_python(const Foo* p) {
return to_python(*p); // convert const Foo* in terms of const Foo&
BOOST_PYTHON_BEGIN_CONVERSION_NAMESPACE // this is an MSVC / gcc 2.95.2 bug workaround
PyObject* to_python(boost::python::semantics, const Foo* p) {
return to_python(boost::python::search_namespace, *p); // convert const Foo* in terms of const Foo&
}
BOOST_PYTHON_END_CONVERSION_NAMESPACE
</pre></blockquote>
@@ -83,12 +83,12 @@ code before the last Python reference to it disappears:
<blockquote><pre>
BOOST_PYTHON_BEGIN_CONVERSION_NAMESPACE // this is a gcc 2.95.2 bug workaround
PyObject* to_python(Foo* p)
PyObject* to_python(boost::python::semantics, Foo* p)
{
return boost::python::python_extension_class_converters&ltFoo&gt::ptr_to_python(p);
}
PyObject* to_python(const Foo* p)
PyObject* to_python(boost::python::semantics, const Foo* p)
{
return to_python(const_cast&lt;Foo*&gt;(p));
}