fix doc example typo
[boost.git] / boost / python / refcount.hpp
blob5ba5433c224369fdba03acf83324c613a934855c
1 // Copyright David Abrahams 2002.
2 // Distributed under the Boost Software License, Version 1.0. (See
3 // accompanying file LICENSE_1_0.txt or copy at
4 // http://www.boost.org/LICENSE_1_0.txt)
5 #ifndef REFCOUNT_DWA2002615_HPP
6 # define REFCOUNT_DWA2002615_HPP
8 # include <boost/python/detail/prefix.hpp>
9 # include <boost/python/cast.hpp>
11 namespace boost { namespace python {
13 template <class T>
14 inline T* incref(T* p)
16 Py_INCREF(python::upcast<PyObject>(p));
17 return p;
20 template <class T>
21 inline T* xincref(T* p)
23 Py_XINCREF(python::upcast<PyObject>(p));
24 return p;
27 template <class T>
28 inline void decref(T* p)
30 Py_DECREF(python::upcast<PyObject>(p));
33 template <class T>
34 inline void xdecref(T* p)
36 Py_XDECREF(python::upcast<PyObject>(p));
39 }} // namespace boost::python
41 #endif // REFCOUNT_DWA2002615_HPP