From 57f54952c3bcb6f71232c25068e75fa1729ea7be Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Sat, 16 Nov 2002 23:22:30 +0000 Subject: [PATCH] Bug fix thanks to Mark Russell [SVN r16295] --- doc/v2/lvalue_from_pytype.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/v2/lvalue_from_pytype.html b/doc/v2/lvalue_from_pytype.html index 1788f284..91679b64 100755 --- a/doc/v2/lvalue_from_pytype.html +++ b/doc/v2/lvalue_from_pytype.html @@ -238,8 +238,8 @@ static MemberType& execute(InstanceType& c);

C++ module definition

-#include <boost/python/reference.hpp>
 #include <boost/python/module.hpp>
+#include <boost/python/lvalue_from_pytype.hpp>
 
 // definition lifted from the Python docs
 typedef struct {
@@ -247,7 +247,7 @@ typedef struct {
 } noddy_NoddyObject;
 
 using namespace boost::python;
-static reference<PyObject> cache;
+static handle<> cache;
 
 bool is_cached(noddy_NoddyObject* x)
 {
@@ -256,7 +256,7 @@ bool is_cached(noddy_NoddyObject* x)
 
 void set_cache(noddy_NoddyObject* x)
 {
-   cache.reset((PyObject*)x, ref::increment_count);
+   cache = handle<>(borrowed(x));
 }
 
 BOOST_PYTHON_MODULE(noddy_cache)