Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:50:37

0001 // Copyright David Abrahams 2002.
0002 // Distributed under the Boost Software License, Version 1.0. (See
0003 // accompanying file LICENSE_1_0.txt or copy at
0004 // http://www.boost.org/LICENSE_1_0.txt)
0005 #ifndef DECREF_GUARD_DWA20021220_HPP
0006 # define DECREF_GUARD_DWA20021220_HPP
0007 
0008 namespace boost { namespace python { namespace detail { 
0009 
0010 struct decref_guard
0011 {
0012     decref_guard(PyObject* o) : obj(o) {}
0013     ~decref_guard() { Py_XDECREF(obj); }
0014     void cancel() { obj = 0; }
0015  private:
0016     PyObject* obj;
0017 };
0018 
0019 }}} // namespace boost::python::detail
0020 
0021 #endif // DECREF_GUARD_DWA20021220_HPP