diff options
Diffstat (limited to 'sources/shiboken6/tests/libsample/onlycopy.h')
| -rw-r--r-- | sources/shiboken6/tests/libsample/onlycopy.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sources/shiboken6/tests/libsample/onlycopy.h b/sources/shiboken6/tests/libsample/onlycopy.h index bd414ec34..7dc3e0069 100644 --- a/sources/shiboken6/tests/libsample/onlycopy.h +++ b/sources/shiboken6/tests/libsample/onlycopy.h @@ -7,6 +7,7 @@ #include "libsamplemacros.h" #include <list> +#include <memory> // These classes simulate a situation found in QWebEngineHistoryItem. @@ -15,8 +16,8 @@ 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; @@ -24,10 +25,11 @@ public: 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 |
