diff options
Diffstat (limited to 'sources/shiboken6/tests/libsample/nondefaultctor.h')
-rw-r--r-- | sources/shiboken6/tests/libsample/nondefaultctor.h | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/sources/shiboken6/tests/libsample/nondefaultctor.h b/sources/shiboken6/tests/libsample/nondefaultctor.h new file mode 100644 index 000000000..fa97b8859 --- /dev/null +++ b/sources/shiboken6/tests/libsample/nondefaultctor.h @@ -0,0 +1,54 @@ +// 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 NONDEFAULTCTOR_H +#define NONDEFAULTCTOR_H + +#include "libsamplemacros.h" + +class NonDefaultCtor +{ +public: + LIBMINIMAL_DEFAULT_COPY_MOVE(NonDefaultCtor) + + explicit NonDefaultCtor(int value) noexcept : m_value(value) + { + } + + virtual ~NonDefaultCtor() = default; + + inline int value() const + { + return m_value; + } + + inline NonDefaultCtor returnMyself() + { + return *this; + } + + inline NonDefaultCtor returnMyself(int) + { + return *this; + } + + inline NonDefaultCtor returnMyself(int, NonDefaultCtor) + { + return *this; + } + + virtual NonDefaultCtor returnMyselfVirtual() + { + return *this; + } + + inline NonDefaultCtor callReturnMyselfVirtual() + { + return returnMyselfVirtual(); + } + +private: + int m_value; +}; + +#endif // NONDEFAULTCTOR_H |