Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/boost/python/detail/decref_guard.hpp @ 29

Last change on this file since 29 was 29, checked in by landauf, 16 years ago

updated boost from 1_33_1 to 1_34_1

File size: 572 bytes
Line 
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 DECREF_GUARD_DWA20021220_HPP
6# define DECREF_GUARD_DWA20021220_HPP
7
8namespace boost { namespace python { namespace detail { 
9
10struct decref_guard
11{
12    decref_guard(PyObject* o) : obj(o) {}
13    ~decref_guard() { Py_XDECREF(obj); }
14    void cancel() { obj = 0; }
15 private:
16    PyObject* obj;
17};
18
19}}} // namespace boost::python::detail
20
21#endif // DECREF_GUARD_DWA20021220_HPP
Note: See TracBrowser for help on using the repository browser.