aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/tests/libsample/intwrapper.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sources/shiboken6/tests/libsample/intwrapper.cpp')
-rw-r--r--sources/shiboken6/tests/libsample/intwrapper.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/sources/shiboken6/tests/libsample/intwrapper.cpp b/sources/shiboken6/tests/libsample/intwrapper.cpp
new file mode 100644
index 000000000..0eaf30465
--- /dev/null
+++ b/sources/shiboken6/tests/libsample/intwrapper.cpp
@@ -0,0 +1,36 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+
+#include "intwrapper.h"
+
+int IntWrapper::toInt() const
+{
+ return m_number;
+}
+
+IntWrapper &IntWrapper::operator ++()
+{
+ ++m_number;
+ return *this;
+}
+
+IntWrapper IntWrapper::operator++(int)
+{
+ IntWrapper result(*this);
+ ++m_number;
+ return result;
+}
+
+IntWrapper &IntWrapper::operator--()
+{
+ --m_number;
+ return *this;
+}
+
+IntWrapper IntWrapper::operator--(int)
+{
+ IntWrapper result(*this);
+ --m_number;
+ return result;
+}