2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-24 18:12:43 +00:00

Added reset()

[SVN r16465]
This commit is contained in:
Dave Abrahams
2002-12-01 16:07:54 +00:00
parent 8467f36b80
commit ae9f394906

View File

@@ -109,6 +109,7 @@ class handle
T& operator* () const;
T* get() const;
T* release();
void reset();
operator bool_type() const // never throws
{
@@ -227,6 +228,13 @@ inline T* handle<T>::release()
return result;
}
template <class T>
inline void handle<T>::reset()
{
python::xdecref(m_p);
m_p = 0;
}
// Because get_managed_object must return a non-null PyObject*, we
// return Py_None if the handle is null.
template <class T>