aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/tests/libsample/noimplicitconversion.h
diff options
context:
space:
mode:
Diffstat (limited to 'sources/shiboken6/tests/libsample/noimplicitconversion.h')
-rw-r--r--sources/shiboken6/tests/libsample/noimplicitconversion.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/sources/shiboken6/tests/libsample/noimplicitconversion.h b/sources/shiboken6/tests/libsample/noimplicitconversion.h
new file mode 100644
index 000000000..a0b91380b
--- /dev/null
+++ b/sources/shiboken6/tests/libsample/noimplicitconversion.h
@@ -0,0 +1,27 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+#ifndef NOIMPLICITCONVERSION_H
+#define NOIMPLICITCONVERSION_H
+
+#include "libsamplemacros.h"
+
+// This class must not have implicit conversions AND
+// no conversion operators should be defined in its own module.
+class NoImplicitConversion
+{
+public:
+ explicit NoImplicitConversion(int objId) : m_objId(objId) {}
+ inline int objId() const { return m_objId; }
+ inline static int receivesNoImplicitConversionByValue(NoImplicitConversion arg)
+ { return arg.m_objId; }
+ inline static int receivesNoImplicitConversionByPointer(NoImplicitConversion *arg)
+ { return arg->m_objId; }
+ inline static int receivesNoImplicitConversionByReference(NoImplicitConversion &arg)
+ { return arg.m_objId; }
+private:
+ int m_objId;
+};
+
+#endif // NOIMPLICITCONVERSION_H
+