aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/tests/libsample/onlycopy.h
diff options
context:
space:
mode:
Diffstat (limited to 'sources/shiboken6/tests/libsample/onlycopy.h')
-rw-r--r--sources/shiboken6/tests/libsample/onlycopy.h18
1 files changed, 11 insertions, 7 deletions
diff --git a/sources/shiboken6/tests/libsample/onlycopy.h b/sources/shiboken6/tests/libsample/onlycopy.h
index e7c411a18..7dc3e0069 100644
--- a/sources/shiboken6/tests/libsample/onlycopy.h
+++ b/sources/shiboken6/tests/libsample/onlycopy.h
@@ -5,7 +5,9 @@
#define ONLYCOPYCLASS_H
#include "libsamplemacros.h"
+
#include <list>
+#include <memory>
// These classes simulate a situation found in QWebEngineHistoryItem.
@@ -14,18 +16,20 @@ class OnlyCopyPrivate;
class LIBSAMPLE_API OnlyCopy
{
public:
- OnlyCopy(const OnlyCopy& other);
- OnlyCopy& operator=(const OnlyCopy& other);
+ LIBMINIMAL_DEFAULT_COPY_MOVE(OnlyCopy)
+
~OnlyCopy();
int value() const;
static int getValue(OnlyCopy onlyCopy) { return onlyCopy.value(); }
- static int getValueFromReference(const OnlyCopy& onlyCopy) { return onlyCopy.value(); }
+ static int getValueFromReference(const OnlyCopy &onlyCopy) { return onlyCopy.value(); }
+
private:
- OnlyCopyPrivate *d;
- explicit OnlyCopy(int value);
- explicit OnlyCopy(OnlyCopyPrivate *d); // rejected due to unknown OnlyCopyPrivate
friend class FriendOfOnlyCopy;
+
+ explicit OnlyCopy(int value);
+
+ std::shared_ptr<OnlyCopyPrivate> d;
};
class LIBSAMPLE_API FriendOfOnlyCopy
@@ -35,4 +39,4 @@ public:
static std::list<OnlyCopy> createListOfOnlyCopy(int quantity);
};
-#endif
+#endif // ONLYCOPYCLASS_H