aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/libshiboken/autodecref.h
diff options
context:
space:
mode:
Diffstat (limited to 'sources/shiboken2/libshiboken/autodecref.h')
-rw-r--r--sources/shiboken2/libshiboken/autodecref.h29
1 files changed, 6 insertions, 23 deletions
diff --git a/sources/shiboken2/libshiboken/autodecref.h b/sources/shiboken2/libshiboken/autodecref.h
index 7b6aa47da..72fd236de 100644
--- a/sources/shiboken2/libshiboken/autodecref.h
+++ b/sources/shiboken2/libshiboken/autodecref.h
@@ -43,11 +43,6 @@
#include "sbkpython.h"
#include "basewrapper.h"
-#ifdef _MSC_VER
-__pragma(warning(push))
-__pragma(warning(disable:4522)) // warning: C4522: 'Shiboken::AutoDecRef': multiple assignment operators specified
-#endif
-
struct SbkObject;
namespace Shiboken
{
@@ -58,6 +53,11 @@ namespace Shiboken
struct LIBSHIBOKEN_API AutoDecRef
{
public:
+ AutoDecRef(const AutoDecRef&) = delete;
+ AutoDecRef(AutoDecRef&&) = delete;
+ AutoDecRef& operator=(const AutoDecRef&) = delete;
+ AutoDecRef& operator=(AutoDecRef&&) = delete;
+
/**
* AutoDecRef constructor.
* \param pyobj A borrowed reference to a Python object
@@ -92,35 +92,18 @@ public:
}
/**
- * Decref the current borrowed python reference and take the reference
- * borrowed by \p other, so other.isNull() will return true.
- */
- void operator=(AutoDecRef& other)
- {
- Py_XDECREF(m_pyObj);
- m_pyObj = other.m_pyObj;
- other.m_pyObj = 0;
- }
-
- /**
* Decref the current borrowed python reference and borrow \p other.
*/
- void operator=(PyObject* other)
+ void reset(PyObject* other)
{
Py_XDECREF(m_pyObj);
m_pyObj = other;
}
private:
PyObject* m_pyObj;
- AutoDecRef(const AutoDecRef&);
- AutoDecRef& operator=(const AutoDecRef&);
};
} // namespace Shiboken
-#ifdef _MSC_VER
-__pragma(warning(pop))
-#endif
-
#endif // AUTODECREF_H