From c772038e774c6b756a201ead5190a28bcef27573 Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Wed, 4 Dec 2002 13:36:03 +0000 Subject: [PATCH] Apply fixes from Dirk Gerrits [SVN r16506] --- doc/v2/handle.html | 58 +++++++++++++++++++++++----------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/doc/v2/handle.html b/doc/v2/handle.html index aefe8180..eba16a85 100644 --- a/doc/v2/handle.html +++ b/doc/v2/handle.html @@ -14,7 +14,7 @@ span.c3 {color: #ff0000} h2.c2 {text-align: center} h1.c1 {text-align: center} - + @@ -74,7 +74,6 @@
allow_null
-
@@ -91,13 +90,12 @@

handle is a smart pointer to a Python object type; it holds a pointer of type T*, where T is its template parameter. T must be either a type derived from - PyObject or a POD - type whose initial sizeof(PyObject) bytes are - layout-compatible with PyObject. Use - handle<> at the boundary between tehe - Python/'C' API and high-level code; prefer PyObject or a POD type + whose initial sizeof(PyObject) bytes are layout-compatible + with PyObject. Use handle<> at the + boundary between tehe Python/'C' API and high-level code; prefer object for a generalized - interface to Python objects. + interface to Python objects.

In this document, the term "upcast" refers to an operation which converts a pointer Y* to a base class @@ -174,7 +172,8 @@ virtual ~handle();

-
Effects: Py_XDECREF(upcast<PyObject*>(m_p))
+
Effects: + Py_XDECREF(upcast<PyObject*>(m_p))
 template <class Y>
@@ -182,8 +181,9 @@ explicit handle(detail::borrowed<null_ok<Y> >* p);
 
-
Effects: - Py_XINCREF(upcast<PyObject*>(p)); m_p = upcast<T*>(p);
+
Effects: + Py_XINCREF(upcast<PyObject*>(p)); + m_p = upcast<T*>(p);
 template <class Y>
@@ -192,7 +192,8 @@ explicit handle(null_ok<detail::borrowed<Y> >* p);
 
     
Effects: - Py_XINCREF(upcast<PyObject*>(p)); m_p = upcast<T*>(p);
+ Py_XINCREF(upcast<PyObject*>(p)); + m_p = upcast<T*>(p);
 template <class Y>
@@ -201,7 +202,8 @@ explicit handle(detail::borrowed<Y>* p);
 
     
Effects: - Py_XINCREF(upcast<PyObject*>(p)); m_p = upcast<T*>(Py_XINCREF(upcast<PyObject*>(p)); + m_p = upcast<T*>(expect_non_null(p));
@@ -211,7 +213,7 @@ explicit handle(null_ok<Y>* p);
 
     
Effects: - Py_XINCREF(upcast<PyObject*>(p)); m_p = upcast<T*>(p);
+ m_p = upcast<T*>(p);
 template <class Y>
@@ -220,8 +222,7 @@ explicit handle(Y* p);
 
     
Effects: - Py_XINCREF(upcast<PyObject*>(p)); m_p = upcast<T*>(m_p = upcast<T*>(expect_non_null(p));
@@ -252,7 +253,8 @@ handle& operator=(handle<Y> const & r); // never throws
 
     
Effects: - Py_XINCREF(upcast<PyObject*>(r.m_p)); Py_XDECREF(upcast<PyObject*>(m_p)); m_p = r.m_p;
+ Py_XINCREF(upcast<PyObject*>(r.m_p)); Py_XDECREF( + upcast<PyObject*>(m_p)); m_p = r.m_p;
 T* release();
@@ -262,13 +264,13 @@ T* release();
       
Effects: T* x = m_p; m_p = 0;return x;
-
 void reset();
 
-
Effects: *this = handle<T>();
+
Effects: + *this = handle<T>();

Class handle @@ -301,28 +303,26 @@ operator bool_type() const; // never throws

borrowed

-template 
-detail::borrowed* borrowed(T* p)
+template <class T>
+detail::borrowed<T>* borrowed(T* p)
 {
-    return (detail::borrowed*)p;
+    return (detail::borrowed<T>*)p;
 }
 

allow_null

-
-template 
-null_ok* allow_null(T* p)
+template <class T>
+null_ok<T>* allow_null(T* p)
 {
-    return (null_ok*)p;
+    return (null_ok<T>*)p;
 }
 
-

Revised - 13 November, 2002 - + 13 November, 2002 +

© Copyright