diff options
Diffstat (limited to 'sources/shiboken6/tests/libsample/privatector.h')
-rw-r--r-- | sources/shiboken6/tests/libsample/privatector.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/sources/shiboken6/tests/libsample/privatector.h b/sources/shiboken6/tests/libsample/privatector.h new file mode 100644 index 000000000..3b38414f8 --- /dev/null +++ b/sources/shiboken6/tests/libsample/privatector.h @@ -0,0 +1,42 @@ +// 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 PRIVATECTOR_H +#define PRIVATECTOR_H + +#include "libsamplemacros.h" + +class PrivateCtor +{ +public: + inline static PrivateCtor *instance() + { + static PrivateCtor self; + self.m_instantiations++; + return &self; + } + + inline int instanceCalls() + { + return m_instantiations; + } + +private: + int m_instantiations = 0; + + PrivateCtor() = default; +}; + +class DeletedDefaultCtor +{ +public: + DeletedDefaultCtor() = delete; + + DeletedDefaultCtor(const DeletedDefaultCtor &) = default; + DeletedDefaultCtor(DeletedDefaultCtor &&) = default; + DeletedDefaultCtor &operator=(const DeletedDefaultCtor &) = default; + DeletedDefaultCtor &operator=(DeletedDefaultCtor &&) = default; + ~DeletedDefaultCtor() = default; +}; + +#endif // PRIVATECTOR_H |